using AMC with filter, but just for series not movies

All your suggestions, requests and ideas for future development
Post Reply
garfield69
Posts: 4
Joined: 01 Jul 2016, 20:22

using AMC with filter, but just for series not movies

Post by garfield69 »

I am currently calling filebot from uTorrent in the Run this program when a torrent changes state with the following command line:

Code: Select all

"C:\Program Files\FileBot\filebot.launcher.exe" -script fn:amc --action move -non-strict -no-xattr --log-file "d:/tv/amc.log" --filter "age < 92|| !model.any{ it.age < 92}" --def "@d:/TV/amc_args.txt" "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"
and I control AMC via a parameters file:

Code: Select all

ut_state_allow=11
unsorted=n
music=n
artwork=n
extras=n
skipExtract=y
clean=y
seriesFormat=D:/TV/{n.sortName('$2, $1').replaceTrailingBrackets()}/s{s}e{e.pad(2)} {t.replaceAll(/[!?.]+$/).replaceAll(/[`´‘’?]/, "'").lowerTrail()}
movieFormat=X:/AVI/{n.sortName('$2, $1').lowerTrail()} ({y}) {vf} {ac}{af}
However at the moment the Filter gets applied for both my series and movies.
Is there a way I can tell AMC that the filter should only be used for series ?
User avatar
rednoah
The Source
Posts: 23023
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: using AMC with filter, but just for series not movies

Post by rednoah »

You can change the filter so that it'll always return true for movie objects.
:idea: Please read the FAQ and How to Request Help.
garfield69
Posts: 4
Joined: 01 Jul 2016, 20:22

Re: using AMC with filter, but just for series not movies

Post by garfield69 »

rednoah wrote:You can change the filter so that it'll always return true for movie objects.
Would you be so kind as to provide me an example?
something like:

Code: Select all

--filter "isMovie()|| age < 92|| !model.any{ it.age < 92}"
Thanks.
User avatar
rednoah
The Source
Posts: 23023
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: using AMC with filter, but just for series not movies

Post by rednoah »

Because of the The Unwind-on-Undefined Behaviour and lack of isMovie/isEpisode/etc functions this might seem a bit tricky at first.

e.g.

Code: Select all

any{episode; age < 92}{true}
episode will throw an Exception for non-Episode objects, so it'll always default to true for non-Episode objects. A side-effect is that if age errors out for some reason it'll also default to true in the same way, which may or may not be desired behaviour. :lol:
:idea: Please read the FAQ and How to Request Help.
garfield69
Posts: 4
Joined: 01 Jul 2016, 20:22

Re: using AMC with filter, but just for series not movies

Post by garfield69 »

That's terrific. Thank you very much.
Post Reply