Page 1 of 1

Adding duplicate torrents

Posted: Sat Jan 04, 2014 4:34 am
by the4tress
How can I identify if a torrent I am adding already exists? Basically I want to be able to add a torrent, but if it already exists, copy it from its current location to another location.

I tried some scripts in the Execute plugin but it never triggers if the torrent already exists.

Re: Adding duplicate torrents

Posted: Mon Jan 13, 2014 8:33 pm
by TrevorLaneRay
the4tress wrote:How can I identify if a torrent I am adding already exists? Basically I want to be able to add a torrent, but if it already exists, copy it from its current location to another location.
When you say "copy it from its current location to another location," do you mean mark it as complete?
Or having Deluge compare hashes between active/completed torrents to automatically merge them?

Having deluge check against files that aren't in the torrent list is a tad infeasible, as it wouldn't be able to check hashes reliably on files it isn't using.

All in all, I'd probably recommend just watching what torrents you add to begin with. :)

Re: Adding duplicate torrents

Posted: Mon Jan 13, 2014 11:35 pm
by the4tress
Basically I have a Deluge session running that monitors multiple folders from different people. When user-a adds a torrent to their folder, deluge downloads it and runs an Execute script I have which copies it to their folder, then seeds the original for 14 days and automatically removes it. The problem is when user-b adds the same torrent file. Deluge will pick up the .torrent, but doesn't do anything because the torrent already exists.

I want to be able to get a response of some sort either through the logs or an error that says the torrent already exists. Then I will edit my script to find that file in deluge via the API and copy the completed file to user-b's folder.

So is there any location that I can look to see when Deluge adds a torrent that already exists?

Thanks for any info.

Re: Adding duplicate torrents

Posted: Mon Jan 13, 2014 11:58 pm
by Cas
If you are happy modifying the code there is a log debug line which you could change to info: http://git.deluge-torrent.org/deluge/tr ... table#n383

Re: Adding duplicate torrents

Posted: Tue Jan 14, 2014 1:21 am
by the4tress
Cas:

That's awesome! Thanks! I'll actually just modify that section to do what I want instead of monitoring the log.