Separate watch & completed directories.

jith45

Member
May 25, 2018
960
0
16
So I'm trying to get into the business of transcoding FLACs, but my FLAC torrents get mixed up with my normal ones and it's all silly because I need to batch download things to the proper locations. To compensate for this, I've created appropriate directories for my FLAC torrents and files, but I don't know how to get a separate watch directory working and move the completed torrent files to their directory as well - what I've done so far has broken my normal watch directory. I tried doing this, but the people in #rtorrent laughed at me and wouldn't help so I came here. Hope you guys are a bit better. Anyway, here's what I tried:

Code:
directory = ~/files
schedule = watch_directory_1,10,10,"load_start=~/watch/*.torrent"
schedule = watch_directory_2,10,10,"load=~/watch/FLACs/*.torrent,d.set_custom6=~/FLACs"
system.method.set_key = event.download.finished,move_complete,"d.set_directory=$d.get_custom6= ;execute=mv,-u,$d.get_base_path=,$d.get_custom6="
Any help is appreciated!
 

somus1735

Member
May 25, 2018
833
0
16
rTorrent hasnt "custom6". Only custom1-custom5. If you use ruTorrent then you must use named customs instead.
Something like
d.set_custom=varname,varvalue
d.get_custom=varname
 

jith45

Member
May 25, 2018
960
0
16
So like this then?

Code:
directory = ~/files
schedule = watch_directory_1,10,10,"load_start=~/watch/*.torrent"
schedule = watch_directory_2,10,10,"load=~/watch/FLACs/*.torrent,d.set_custom=datflac,~/FLACs"
system.method.set_key = event.download.finished,move_complete,"d.set_directory=$d.get_custom=datflac, ;execute=mv,-u,$d.get_base_path=,$d.get_custom=datflac,"
 

dsouvik215

Member
May 25, 2018
896
0
16
Like this:

Code:
directory = ~/files
schedule = watch_directory_1,10,10,"load_start=~/watch/*.torrent"
schedule = watch_directory_2,10,10,"load=~/watch/FLACs/*.torrent,d.set_custom=datflac,~/FLACs"
system.method.set_key = event.download.finished,move_complete,"d.set_directory=$d.get_custom=datflac ;execute={mv,-u,$d.get_base_path=,$d.get_custom=datflac}"
 

dsouvik215

Member
May 25, 2018
896
0
16
1) Add d.set_directory to the first schedule. Or
2) Add branch= part to move_complete. Or
3) Forget about this and use plugin 'autotools', feature 'autowatch'.
 

jith45

Member
May 25, 2018
960
0
16
So for branch=part, it should be like this?

Code:
directory = ~/files
schedule = watch_directory_1,10,10,"load_start=~/watch/*.torrent"
schedule = watch_directory_2,10,10,"load=~/watch/FLACs/*.torrent,d.set_custom=datflac,~/FLACs"
system.method.set_key = event.download.finished,move_complete,branch=part,"d.set_directory=$d.get_custom=datflac ;execute={mv,-u,$d.get_base_path=,$d.get_custom=datflac}"
 

jith45

Member
May 25, 2018
960
0
16
No. Read something about branch command.
From this page:

http://libtorrent.rakshasa.no/wiki/RTorrentCommands

And this example:

Code: [Select]
if (cond1) { branch1 }
<cond1>,<branch1>

if (cond1) { branch1 } else if (cond2) { branch2 } else { branch3 }
<cond1>,<branch1>,<cond2>,<branch2>,<branch3>

on_start = test1,"if=$d.get_custom1=,\\$d.set_custom2=$d.get_custom1=,\\$d.set_custom2=foo"
Where do I insert the branch? This is what I am assuming I need to start with:

Code:
directory = ~/files
schedule = watch_directory_1,10,10,"load_start=~/watch/*.torrent"
schedule = watch_directory_2,10,10,"load=~/watch/FLACs/*.torrent,d.set_custom=datflac,~/FLACs"
system.method.set_key = event.download.finished,move_complete,"d.set_directory=$d.get_custom=datflac ;execute={mv,-u,$d.get_base_path=,$d.get_custom=datflac}"
An if / else statement should go somewhere within the download and directory settings, but I don't know the syntax or structure for it. I understand that you have to specify each directory and variable for each case, I just don't know how to do that.

Furthermore, please understand that I'm not experienced with this syntax or system in general - there are things that I am good at and have even written guides for because they are relatively intuitive when explained to you properly - I'm betting this is the same way, but I don't have a background in it and all I'm asking for is some help. I'll be out of your hair if you can help me understand what exactly I'm writing and how it works better, and then when people have my problem and search for it they'll have a resource.
 

dsouvik215

Member
May 25, 2018
896
0
16
Are you really understanding your problem?
Code:
schedule = watch_directory_1,10,10,"load_start=~/watch/*.torrent"

get_custom=datflac is undefined after this...
Code:
system.method.set_key = event.download.finished,move_complete,"d.set_directory=$d.get_custom=datflac

... and you set directory to undefined value at this point. As result - you must set datflac at *both* shedules. Or you must use branch at system.method.set_key. Something like that -

system.method.set_key = event.download.finished,move_complete,"branch=$d.get_custom=datflac,\"d.set_directory=$d.get_custom=datflac ;execute={mv,-u,$d.get_base_path=,$d.get_custom=datflac}\""

Furthermore, please understand that I'm not experienced with this syntax or system in general -
In this case see point 3 from my previous post.
 

jith45

Member
May 25, 2018
960
0
16
Are you really understanding your problem?
Code:
schedule = watch_directory_1,10,10,"load_start=~/watch/*.torrent"

get_custom=datflac is undefined after this...
Code:
system.method.set_key = event.download.finished,move_complete,"d.set_directory=$d.get_custom=datflac

... and you set directory to undefined value at this point. As result - you must set datflac at *both* shedules. Or you must use branch at system.method.set_key. Something like that -

system.method.set_key = event.download.finished,move_complete,"branch=$d.get_custom=datflac,\"d.set_directory=$d.get_custom=datflac ;execute={mv,-u,$d.get_base_path=,$d.get_custom=datflac}\""



In this case see point 3 from my previous post.
Okay, so let's see if I can understand this starting there. One thing at a time. Does that mean that this will work? From what I understand setting the custom variable says "hey, I'm a custom filepath use me for things" but I don't get why it needs to be included twice - is it because if you don't then it only uses one?

Code:
directory = ~/files
schedule = watch_directory_1,10,10,"load_start=~/watch/*.torrent,d.set_custom=datflac,~/FLACs"
schedule = watch_directory_2,10,10,"load_start=~/watch/FLACs/*.torrent,d.set_custom=datflac,~/FLACs"
system.method.set_key = event.download.finished,move_complete,"d.set_directory=$d.get_custom=datflac ;execute={mv,-u,$d.get_base_path=,$d.get_custom=datflac}"
 

dsouvik215

Member
May 25, 2018
896
0
16
Yet once. You have two 'schedule' statements. In second you define variable datflac, in first - not. But event.download.finished will work for *both* cases. As result - you will set torrent's directory to empty for first statement. Is you really want this?

Quote
Does that mean that this will work?​


Will work. But all torrents will be saved to '~/FLACs' directory. Always.
 

jith45

Member
May 25, 2018
960
0
16
No, no I don't want that... you're very right.

So can you help me understand branch statements then? As mentioned the way that the config uses a system of quotes and parentheses rather than something like C++ is making it hard for me to understand where and how you would define the if and else statements.
 

dsouvik215

Member
May 25, 2018
896
0
16
Is there a particular reason you can't just help me solve it and be on my merry way then? I don't intend to cause problems or stir up issues, I just want to learn and help others in the future. sad.gif