[Bug] 0.18.4 tdl restores context in weird way
Describe the bug
It restores the context to download new file instead of continuing currently downloading file, which draws this functionality actually useless, especially when you are QoS'd by TG server.
1 2 download gets "paused", then 3 4 gets continued by ctx restore, and then 5 6... infinite loop just like this. in the end you have to disregard them all because you actually gets nothing, as tdl doesn't have functionality of resuming from downloaded point after session restart.
To Reproduce
tdl dl -f tdl-export.json --pool 0 -t 2 -l 2 --debug --continue --skip-same --reconnect-timeout 0
💬 MyChannel(1234):1 -> downloads\1234_1_a~ ... 83.3% [###############....] [688.00 MB in 8h4m17.328s; ~ETA: 1h39m12s; 24.25 KB/s]
💬 MyChannel(1234):2 -> downloads\1234_2_b~ ... 39.9% [#######............] [721.00 MB in 7h12m17.091s; ~ETA: 11h16m8s; 28.46 KB/s]
💬 MyChannel(1234):3 -> downloads\1234_3_c~ ... 85.6% [################...] [657.00 MB in 5h7m42.875s; ~ETA: 54m18s; 36.44 KB/s]
💬 MyChannel(1234):4 -> downloads\1234_4_d~ ... 47.6% [#########..........] [444.00 MB in 2h22m52.315s; ~ETA: 2h41m7s; 53.04 KB/s]
💬 MyChannel(1234):5 -> downloads\1234_5_e~ ... 72.9% [#############......] [377.00 MB in 1h5m30.695s; ~ETA: 25m29s; 98.21 KB/s]
💬 MyChannel(1234):6 -> downloads\1234_6_f~ ... 32.0% [######.............] [293.00 MB in 53m46.544s; ~ETA: 1h54m16s; 92.99 KB/s]
as you can see, 1,2 and 3,4 files are actually never resumed from 5~8hrs of download queue.
Expected behavior
It should continue downloading "paused" file instead of starting new download.
Version
Version: 0.18.4 Commit: 8728f56 Date: 2025-01-23T07:19:57Z
go1.21.13 windows/amd64
Which OS are you running tdl on?
Windows
Additional context
Written in reproduce space.
Does this situation occur in the old version?
Does this situation occur in the old version?
As far as i know, in the old version it just gets stuck forever (for example with above log, old version gets stuck forever downloading 1 and 2)
@tdlbugreport Are there any old versions with stable work? I want to check their diffs.
@tdlbugreport Are there any old versions with stable work? I want to check their diffs.
Well, i dont have old logs to compare for now(if you meant that). i used v0.18.3 before recent v0.18.4 update. if you want me to, i can report back with download logs after trying to download them on v0.18.3 but obviously it will take a day to generate them.
possible relevant log/issue: https://github.com/iyear/tdl/issues/854
@iyear this seems to be critical issue. seems like tdl is marking those "paused" files as completed (file extensions are also changed to original ones just like it's fully downloaded) and does not redownload them even after force (ctrl+c) termination, which disguises corrupted files as a complete files.