qbittorrent / qBittorrent

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

Run external program does not wait for files to be moved #11842

Open napei opened 4 years ago

napei commented 4 years ago

qBittorrent version and Operating System

4.1.9.1 Windows 10 Pro (10.0.1xxxx)

What is the problem

"Run external program on torrent completion" does not appear to wait for torrent's to finish moving, causing issues when trying to run auto-extraction programs on them or using file managers to handle state of media.

What is the expected behavior

It would be nice, if "torrent completion" could refer to after it has been moved, rechecked, or started seeding.

Steps to reproduce

Download any torrent. Enable automatic management and have torrent moved to different directory when download, and another when seeding. Add a command to run after torrent completion that does something like extract the archive. Nothing appears to happen, because the torrent doesn't seem to be there yet

Extra info(if any)

The most common solution that I know of and use is to just encapsulate the external program in cmd /c "timeout /t 10 & externalprogram.exe", and while this works fine, giving a 10 second timeout, shouldn't be needed as it causes confusion. Furthermore, if the moving operation is between drives on the PC, then 10 seconds may not be enough, and the timeout would need to become dynamic based on the torrent size which isn't friendly. This is for windows (cmd.exe) so I'm not sure of other operating systems.

Disclaimer: this issue may already be fixed in 4.2, and also could already be an issue in progress. Just bugging me for a while.

UnconditionalLoop commented 3 years ago

It's a been a year and this still hasn't been fixed! Since external applications are based on %D path, any files created or changed, end up getting left over and never moved!

Easy fix! Make external program run AFTER the files have been moved to the proper folder based on their category setting.

luzpaz commented 1 year ago

Related to #10206