qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
28.45k stars 4k forks source link

Partial download says 100% complete but when added back says only 99%. #21388

Open Piber0 opened 1 month ago

Piber0 commented 1 month ago

qBittorrent & operating system versions

qBittorrent: 4.6.7 (64-bit) Operating system: Windows 11 Home 23H2 x64

Qt: 6.4.3 Libtorrent: 1.2.19.0 Boost: 1.86.0 OpenSSL: 1.1.1w zlib: 1.3.1

What is the problem?

During a partial file download, qBittorrent tells me that they are completed at 100%, but when I delete and then re-add the .torrent, it indicates that they are only completed at 99% (most often at 99.9%).

Steps to reproduce

  1. Add a torrent, for example: https://github.com/mon5termatt/medicat_installer/raw/main/download/MediCat_USB_v21.12.torrent
  2. Select only MediCat.USB.v21.12.7z
  3. Wait for the file to reach 100%
  4. Delete .torrent (but not its contents)
  5. Re-add the same .torrent (You can select the stop condition: files checked for ease of use.)
  6. Wait for the file to be checked and see that it is only 99.9% downloaded.

Additional context

This problem has already occurred when I selected only the .mkv files from a torrent containing .nfo or .jpg files.

I tried checking "Recheck torrents on completion" in the advanced options. The file was indeed verified at 100%, but the same problem occurred after deleting and re-adding it.

I also tried to create a .torrent of this file marked as 99.9% complete in order to compare it to the original .torrent, and it appears to be similar with a length of 22,994,783,619 bytes. I also did the same for a pack of 30 .mkv files and found that they were all the same length as the original .torrent, but also marked by qbittorrent as only 99% complete.

I have already tried forcing the verification and also downloading the few % marked as missing, but the same observation occurred after deleting and re-adding it.

This problem has already appeared in version 4.6.6 (and probably also before).

Log(s) & preferences file(s)

No response

glassez commented 1 month ago

This is most likely due to the cross-file piece, the first part of which is in selected file and the rest (belonging to unselected one) is placed in a .parts file that is deleted along with the torrent. Therefore, this piece is missing when re-add torrent.

HanabishiRecca commented 1 month ago

Yes, .parts file is always being deleted along with the torrent, even if you chose to keep the content.

https://github.com/qbittorrent/qBittorrent/blob/a23f45cc70e7bb32924ef01f080f73dd1c83d2be/src/base/bittorrent/sessionimpl.cpp#L2436

So this is intended behavior, not a bug.