Page 1 of 1

using AMC with filter, but just for series not movies

Posted: 01 Jul 2016, 20:36
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 ?

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

Posted: 02 Jul 2016, 04:49
by rednoah
You can change the filter so that it'll always return true for movie objects.

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

Posted: 02 Jul 2016, 08:17
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.

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

Posted: 02 Jul 2016, 09:39
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:

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

Posted: 02 Jul 2016, 18:00
by garfield69
That's terrific. Thank you very much.