Manually triggering "Torrent Complete"

Suggest, post, or discuss plugins for Deluge
Post Reply
scerwrz
New User
New User
Posts: 3
Joined: Wed Mar 14, 2012 8:01 pm

Manually triggering "Torrent Complete"

Post by scerwrz »

Hi,
is there a way to manually trigger a "Torrent Complete" event for torrents which are already completed and seeded?

Thanks
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Manually triggering "Torrent Complete"

Post by Cas »

If you add a completed torrent to Deluge the EventManager will not emit a TorrentFinishedEvent. Can you explain what you are trying to do as there may be an alternative option.
scerwrz
New User
New User
Posts: 3
Joined: Wed Mar 14, 2012 8:01 pm

Re: Manually triggering "Torrent Complete"

Post by scerwrz »

I am using this script to transfer completed torrents in Deluge (downloading and short-term seeding), to rTorrent (long-term seeding).

I still have about 100 torrents in Deluge which were not transferred to rTorrent, as I started using the script after these torrents were completed. Simply running the script globally is not an option because I still have unfinished torrents, and that would create problems. Is there a way to manually trigger a "TorrentFinishedEvent" for already completed torrents?

Thanks
chimpy
New User
New User
Posts: 6
Joined: Sun Mar 11, 2012 4:06 pm

Re: Manually triggering "Torrent Complete"

Post by chimpy »

Hey, author of that script here.

I'm pretty sure the Perl script doesn't actually process unfinished torrents. It throws out an error if a file doesn't exist (though only if a file doesn't EXIST, it processes it if the file(s) exist, but are nevertheless unfinished).

What I would advise you do is this:

• Stop rTorrent for the moment.
• Clear rTorrent's watch folder so that after the transfer you'll only see the newly created .torrent files.
• Change the last do statement to:

Code: Select all

do
       name=basename $f
       perl $dir/rtorrent_fast_resume.pl $download < $f > $watch/$name
done
This will ensure that when you run it globally your torrent files will stay in Deluge's session directory (removal of rm command), and that the torrents should identically named (basename command + variable). I haven't tested this but I can't see any reason why it wouldn't work.

Now do "ls -l | wc -l" on rTorrent's watch dir and Deluge's state directory. Subtract one from the result on the watch dir and subtract three from the state dir result (lines/files we don't care about). Now subtract the state dir result from the watch dir result. If that number equals your amount of unfinished torrents you're golden. If not (let's says it's 10, and you have 12 unfinished), you'll need to look at your unfinished torrents' hashes and see which ones have been transferred to the watch dir. I know, it's lame, but that's all I can think of. HTH.

I suppose you could always wait for them to finish and then run the script globally. Maybe that'll be easier.
Post Reply