Jump to content

"Run this program when a torrent finishes" doesn't really do what it says.


Drakkim

Recommended Posts

I've done some experimenting and done some searching and there a a few threads out there that hit close to this one in troubleshooting, but they're all old. Rather than necro a thread that's almost the same thing, I'm starting a new one.

 

Problem: "Run this program when a torrent finishes" doesn't really do what it says.

 

Test: add a command to "Run this program when a torrent finishes"

Expected outcome: The program runs when a torrent reaches "Finished" status

Actual outcome: The program starts when downloading reaches 100%

 

Steps to reproduce:

 

1. Create a batch file "C:\test.bat" containing the following 2 lines:



echo %1
pause


 

2. In Preferences / Advanced / Run Program / "Run this program when a torrent finishes" add this text:



C:\test.bat %S


 

3. Start any torrent. When it downloading reaches 100% you get a pop-up with a number - probably 5 or 20. If the torrent were "Finished" it should be status 11.

 

Details:

My end goal is to rename video files and move them into my library when a download is complete because XBMC is a bit pickier about file names than the kind people that make the downloads available. In getting to this goal, I've found  several snags. Workarounds so far include setting bt.read_only_on_complete = false to unlock the files after the download completes.

 

My final hurdle is that the option to "Run this program when a torrent finishes" doesn't really do what it says. It runs the program when the download reaches 100% and seeding begins (when status changes to 5 or 20, not when status changes to 11)

 

I can see the argument that downloading has finished at this point, but the rest of the program uses "Finished" to mean that all files transfers have completed and seeding, moving, etc. are complete.

 

My current workaround is to run a match file whenever a torrent changes state and have it stop if %S = anything other than 11. That solves the goal, but with an irritating side effect: dozens of flashing CMD windows as torrents start and stop.

 

One test torrent immediately flashed up 2 windows (status 12 and 17) on start and another flashed 4 as it started seeding (3 of them status 20s and a single 5) then FINALLY gave me a status 11. None of this would be necessary if only "Run this program when a torrent finishes" actually ran programs when a torrent reached status 11 (Finished). Restarting uTorrent also nets me a status 12 and 17 for each torrent running (ack!).

 

The current beta (3.4.2 build 39424) still runs the program at status 5 or 20 (seeding or moving) whichever comes after downloading reaches 100%. 

 

Would it be possible in a future version, so as to not break existing scripts, to rename the existing feature (maybe to "Run this program when a download reaches 100%") and make "Run this program when a torrent finishes" actually relate to a finished torrent?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...