libtorrent version
2.0.x (reproduced on 2.0.11.0)
Problem
When some files have dont_download priority and are physically deleted from disk, calling force_recheck() does not recalculate total_wanted / total_wanted_done in torrent_status.
After the recheck completes, total_wanted still reflects a stale value — it no longer matches the sum of sizes of files with priority > dont_download.
Steps to reproduce
- Add a multi-file torrent and download all files
- Set one file's priority to
dont_download (priority 0)
- Physically delete that file from disk
- Call
force_recheck() on the torrent handle
- After the check completes, inspect
torrent_status::total_wanted
Expected: total_wanted reflects only the files with priority > 0
Actual: total_wanted shows a stale/incorrect value
Workaround
Calling prioritize_files() again after the recheck completes (with the same priorities) forces libtorrent to recalculate total_wanted correctly.
Context
This was reported downstream in qBittorrent as qbittorrent/qBittorrent#23151. We have a workaround PR that re-applies file priorities after recheck, but the root cause appears to be in libtorrent.
libtorrent version
2.0.x (reproduced on 2.0.11.0)
Problem
When some files have
dont_downloadpriority and are physically deleted from disk, callingforce_recheck()does not recalculatetotal_wanted/total_wanted_doneintorrent_status.After the recheck completes,
total_wantedstill reflects a stale value — it no longer matches the sum of sizes of files with priority >dont_download.Steps to reproduce
dont_download(priority 0)force_recheck()on the torrent handletorrent_status::total_wantedExpected:
total_wantedreflects only the files with priority > 0Actual:
total_wantedshows a stale/incorrect valueWorkaround
Calling
prioritize_files()again after the recheck completes (with the same priorities) forces libtorrent to recalculatetotal_wantedcorrectly.Context
This was reported downstream in qBittorrent as qbittorrent/qBittorrent#23151. We have a workaround PR that re-applies file priorities after recheck, but the root cause appears to be in libtorrent.