AMC with utorrent only on selected tags

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
psxlover
Posts: 19
Joined: 21 Feb 2015, 17:47

AMC with utorrent only on selected tags

Post by psxlover »

I'd like to add the run command on utorrent but I only want it to work with certain labels.
Is there a way to tell it to run only on certain labels, or to ignore certain labels other than putting "ignore" infront of every other label or messing with the script?
User avatar
rednoah
The Source
Posts: 23930
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC with utorrent only on selected tags

Post by rednoah »

The exec command is called for each processed file, regardless of label, but if label is ignore then no files are processed and nothing is executed.

What you want is not supported, but since you do have full control over the command template...

Code: Select all

--def "exec=do {label =~ /dummy/ ? 'nothing' : 'something'} '{file}'"
The escaping might be a bit tricky, but you can completely change what commands are executed depending on the label, file, etc
:idea: Please read the FAQ and How to Request Help.
whereswaller
Posts: 23
Joined: 05 Mar 2015, 21:59

Re: AMC with utorrent only on selected tags

Post by whereswaller »

Hi rednoah,
I am looking to implement a code similar to that mentioned by psxlover above. I am having a little difficulty applying your suggestion though. Assuming I am using the default AMC code:

Code: Select all

filebot -script fn:amc --output "X:/path/to/media" --log-file amc.log --action copy --conflict override -non-strict --def music=y subtitles=en artwork=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"
Is the default AMC code included within your advised code, for example:

Code: Select all

--def "exec=do {label =~ /dummy/ ? 'nothing' : ' '{file}'" filebot -script fn:amc --output "X:/path/to/media" --log-file amc.log --action copy --conflict override -non-strict --def music=y subtitles=en artwork=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"'}
Or is the advised code included within the default AMC code, for example:

Code: Select all

filebot -script fn:amc --output "X:/path/to/media" --log-file amc.log --action copy --conflict override -non-strict --def music=y subtitles=en artwork=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"--def "exec=do {label =~ /dummy/ ? 'nothing' : 'something'} '{file}'"
Can you please also assist by specifying what the variables are in your above code? I assume:

dummy = label
nothing = action if label is matched (leave blank if you want nothing to happen)
something = action if label is not matched (leave blank if you want nothing to happen)

Thanks for your help as always.
User avatar
rednoah
The Source
Posts: 23930
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC with utorrent only on selected tags

Post by rednoah »

1)
exec is a script option, so it's filebot -script ... --def exec=command syntax.

2)
{label} is whatever you pass in via --def ut_label=value.

3)
Do you understand how the format works? The --def exec option works exactly the same way except that you're building a command which is subsequently executed.

In the example above a fictitious command called "do" would be called for each file, and what exact parameters are passed when executing "do" should be obvious.
:idea: Please read the FAQ and How to Request Help.
Post Reply