Page 1 of 1

Filter files with undefined binding

Posted: 20 Aug 2017, 13:17
by devster
Hello, I'm trying to list all files which don't have a Release Group (but could be any kind of binding).
This is what I tried, but I'm missing something:

Code: Select all

filebot -mediainfo -r 'Season 01' --filter 'file.isVideo() && !group' --format {f}
filebot -mediainfo -r 'Season 01' --filter 'file.isVideo() && group == null' --format {f}
filebot -mediainfo -r 'Season 01' --filter 'file.isVideo() && group == ""' --format {f}
In short I don't understand how to the absence of a binding should be tested.
Thanks.

Re: Filter files with undefined binding

Posted: 20 Aug 2017, 13:57
by rednoah
Check if group is defined:

Code: Select all

--filter group
Check if file is video and if group is defined:

Code: Select all

--filter "f.video && group"
Check if file is video and if group is not defined:

Code: Select all

--filter "f.video && any{group}{null} == null"
@see viewtopic.php?f=5&t=1895


:idea: group will throw an Exception if it's undefined. Filter expressions that throw an Exception evaluate to false.