Jump to content

Trouble with "Run this program when a torrent..."


Byshop

Recommended Posts

Hi all,

I'm running into a bit of an issue with this option. I've written a script that auto-sorts and auto-extracts based on data pulled from the uTorrent "Run Program" variables. Since my script is set to perform file move operations, I pass it the state number of the torrent and I tell it to ignore all states except 11 (Finished).

The script works fine (well, it needs some work but per the Utorrent logs it's not the culprit here), but when I use either "change state" or "finishes" I hit one of two problems:

If I use "when a torrent changes state" and ignore all state changes except for 11, sometimes uTorrent will trigger the script up to three times for the "11" state. Since the first thing I do is create a new folder to move my content into, the subsequent script executions fail when they don't find the originally specified directory. If uTorrent only calls the script once for state "11" then it works great, but every once in a while it'll spaz out. The log doesn't give me any clear idea of what causes this to sometimes happen, only that it did happen.

If I use "when a torrent finishes" I get some inconsistent behavior, too. The script appears to trigger on state 11 for the most part, but it also seems to trigger on state 5 (Seeding). When this happens, it does not also trigger on 11. Even if I have the torrent set to stop the second it finishes downloading, the script will trigger with a state of 5 or of 11. It almost seems like it's race condition where as soon as the torrent starts seeding it moves to kick off the script, but it may or may not flip to a "Finished" state before uTorrent tries to kick off the script. Since I have to wait until it's done seeding before the script moves the files, I can tell the script to sleep for 10 seconds before processing and assume that it'll pass from Seeding to Finished by that time, but that's a bit of a hack and it keeps from from keeping torrents alive after they hit 100%.

I tried to dig into both of these in the docs, but the CHM is not clear on what "when a torrent finishes" means exactly (i.e. which state does it trigger on, can it re-trigger if the state moves away from Finished and then back again, etc). I apologize if there's anything I missed in the documentation that would have allowed me to resolve this myself.

Thanks in advance.

P.S. This is on version 3.2.3 (build 28705) 32-bit

-Byshop

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...