[Libtorrent-devel] Setting up multiple/conditional event.download.finished?

Balaji Dutt balaji.dutt at gmail.com
Wed Feb 11 12:34:48 UTC 2009


Hi all,

Okay so this took a little bit of time to figure out and I apologize for
being so slow.

I had initially setup the branch condition like so:

system.method.set_key =
event.download.finished,check_custom1,"branch=d.get_custom1=,d.set_directory=$d.get_custom1=,d.set_directory=/var/torrent_downloads/completed/"

Since a branch command executes any command you send it, it was actually
"setting" the base_directory path to a new folder before the move happened!

So when I next tried to execute a move command using this:

system.method.set_key =
event.download.finished,move_complete,"execute=mv,-u,$d.get_base_path=,d.set_directory=$d.get_custom1="

This would fail with all sorts of weird errors. Finally figured it out only
when I looked at the Info->Directory data after a failed move.

The workaround was pretty simple, I just used the custom2 variable as a
place holder for the path. So:

system.method.set_key =
event.download.finished,check_custom1,"branch=d.get_custom1=,d.set_custom2=$d.get_custom1=,d.set_custom2=/var/torrent_downloads/completed/"
system.method.set_key =
event.download.finished,move_complete,"d.set_directory=$d.get_custom2=
;execute=mv,-u,$d.get_base_path=,$d.get_custom2="

And voila! no more errors and the torrent continues to seed after
downloading. Yay! :)

--
Balaji


On Tue, Feb 10, 2009 at 10:18 PM, orlando agostinho <
orlando.agostinho at gmail.com> wrote:

> Hi,
>
> Please, check this:
> http://libtorrent.rakshasa.no/wiki/RTorrentCommonTasks#Movecompletedtorrentstodifferentdirectorydependingonwatchdirectory
> maybe help you!
>
> Cheers!
> Orlando Agostinho
> Lisbon/Portugal
>
> On Tue, Feb 10, 2009 at 12:40 PM, Balaji Dutt <balaji.dutt at gmail.com>wrote:
>
>> On Tue, Feb 10, 2009 at 8:36 PM, orlando agostinho <
>> orlando.agostinho at gmail.com> wrote:
>>
>>> Hey,
>>>
>>> Try this
>>>
>>> #log File
>>> execute_log = /home/log/.rtorrent.log
>>>
>>>
>>> #Move
>>> system.method.set_key =
>>> event.download.finished,log_torrent,"execute=mv,-u,$d.get_base_path=,/home/rt/torrents/done/
>>> ;d.set_directory=/home/rt/torrents/done/"
>>>
>>> For me Works!
>>>
>>> Cheers!
>>> Orlando Agostinho
>>>
>>
>>
>> Hi Orlando,
>>
>> Thanks for the tip. Problem is my destination directory isn't fixed - for
>> watched torrents, the destination is folder "A" but for torrents I upload
>> the destination is folder "B".
>>
>> I'm setting the set_directory using a branch command so I'm not sure if
>> the problem is with the branch command or the syntax of the move command :(
>>
>> --
>> Balaji
>>
>> _______________________________________________
>> Libtorrent-devel mailing list
>> Libtorrent-devel at rakshasa.no
>> http://rakshasa.no/mailman/listinfo/libtorrent-devel
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rakshasa.no/pipermail/libtorrent-devel/attachments/20090211/6b814f7a/attachment.html


More information about the Libtorrent-devel mailing list