Trying to apply a filter so that torrents with a specific label use the age filter and all torrents with other labels ignore the filtering altogether but I can't seem to get it working.
filebot -list --q Firefly --filter "if (label == /test/) e < 5" --def ut_label=test
returns 4 episodes as expected
filebot -list --q Firefly --filter "if (label == /test/) e < 5" --def ut_label=other
won't return anything. I expected this to just ignore the filter.
I'm very limited in my understanding in these matters and would appreciate any help in getting this working the way I want it too, if possible.
Cheers
Trying to understand filtering
Re: Trying to understand filtering
You'll want you filter to return true or false depending on your condition:
This is true if and when (1) label not equals test, or (2) e < 5
As for why your original expression doesn't work, in this case, if label is not test, then the result is neither true nor false, which is considered false:
It would work though, if your else-code were to return true:
Code: Select all
label != /test/ || e < 5
As for why your original expression doesn't work, in this case, if label is not test, then the result is neither true nor false, which is considered false:
Code: Select all
if (label == /test/) e < 5
Code: Select all
label == /test/ ? e < 5 : true
Re: Trying to understand filtering
I see! Thanks alot for the explanation!
I got it working!
Follow up question, right now, if there is no label it won't work. Any way to fix that?
I got it working!
Follow up question, right now, if there is no label it won't work. Any way to fix that?

Re: Trying to understand filtering
In that case, this will do:
Explanation: If label is undefined, the filter expression errors out, and that is also is interpreted as false. So we catch these errors and return true instead.
Code: Select all
any{label != /test/ || e < 5}{true}

Re: Trying to understand filtering
Now it's working perfectly. Thanks alot!