Filter issue after upgrade to V5

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Alfke
Posts: 35
Joined: 24 Jan 2017, 18:11

Filter issue after upgrade to V5

Post by Alfke »

Hi Rednoah,

After v5 upgrade, I now get this error when I run my filebot script for TV renaming (movie renaming is not affected):

Code: Select all

"Consider using --filter "true" to allow at least one potential match"
So I added --filter "true" to the command line (and now it renames TV correctly again) but it broke my excludes file filter with this error:

Code: Select all

File does not exist: /home/plex/!readLines('/home/plex/excludes.txt').join().findAll(/\d+[^(19|20)\d{2}]/)*.toInteger().contains(id)
So how do I add the 2nd filter without breaking my excludes filter?

Thanks

Alfke
Licensed User
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filter issue after upgrade to V5

Post by rednoah »

Please copy & paste the complete command-line call, and ideally console output as well, so that we can see what you can see.


:!: Consider using --filter "true" to allow at least one potential match means that your filter has excluded all possible matches, i.e. your filter does not work. filebot suggests replacing your filter (not adding an additional filter) with --filter "true" (i.e. no filter) for testing purposes to help you narrow down the root cause of the issue at hand.


:!: File does not exist: XYZ means that XYZ was passed as input file argument (and not as option value) and so filebot will complain that this "input file" does not exist.


:idea: You can have one --filter expression that checks for multiple things:
rednoah wrote: 27 Oct 2014, 20:54 A more advanced version of the above might only include episode data of recently aired episodes if there are any recently aired episodes, but otherwise default to accepting any episode data:

Code: Select all

--filter 'age < 7 || !model.any{ it.age < 7 }'



EDIT:

Note that readLines() was deprecated some years ago, and FileBot 4.* would print the following message to the console output:

Code: Select all

[DEPRECATED] readLines() is deprecated. Please use lines() instead.
:arrow: readLines() has been removed completely in FileBot 5.* and so you must use lines() instead now:

Code: Select all

lines('/home/plex/excludes.txt')
:idea: Please read the FAQ and How to Request Help.
Alfke
Posts: 35
Joined: 24 Jan 2017, 18:11

Re: Filter issue after upgrade to V5

Post by Alfke »

Thank you for the response. I got the two filters to work as follows:

Code: Select all

--filter "true" --filter "lines '/home/plex/excludes.txt'"
The original line I used was

Code: Select all

--filter "!readLines('/home/plex/excludes.txt').join().findAll(/\d+[^(19|20)\d{2}]/)*.toInteger().contains(id)"
Much more simpler now!

Thanks again

Alfke
Licensed User
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filter issue after upgrade to V5

Post by rednoah »

1.
Adding --filter twice does nothing. The option value that is used last is the one that is used.


2.
This code does not do what you think it does. It merely reads the text file, so it'll return true if the text file is non-empty, and false if the text file is empty, and nothing else:

Code: Select all

lines '/home/plex/excludes.txt'

3.
If your original code uses readLines() like so:

Code: Select all

--filter "!readLines('/home/plex/excludes.txt').join().findAll(/\d+[^(19|20)\d{2}]/)*.toInteger().contains(id)"
then using lines() instead would look exactly the same, except that readLines is replaced with lines:

Code: Select all

--filter "!lines('/home/plex/excludes.txt').join().findAll(/\d+[^(19|20)\d{2}]/)*.toInteger().contains(id)"



EDIT:

Note that /\d+[^(19|20)\d{2}]/ doesn't do what you think it does. [^...] is a negative character set, not a negative-lookahead pattern. I don't have your /home/plex/excludes.txt text file, but my best guess is that your --filter just doesn't work, or rather somehow accidentally does something, but probably not actually what you are trying to do.


:arrow: Please paste a sample /home/plex/excludes.txt and describe your use case (i.e. what you are trying to do) so we can help you write a working --filter expression. You seem to be trying to specifically filter out series IDs listed in your text file?
:idea: Please read the FAQ and How to Request Help.
Alfke
Posts: 35
Joined: 24 Jan 2017, 18:11

Re: Filter issue after upgrade to V5

Post by Alfke »

Hello, my excludes file contains the following:

Code: Select all

 id     Name of TV Show / Movie
-------------------------------
74380   Magnum, P.I. (1980)
72546   CSI: Crime Scene Investigation (2000)

I enabled this feature as Filebot (at that time) kept renaming new episodes using info from these old series.

I'm still unsure what the "true" filter means or if its needed.
Licensed User
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filter issue after upgrade to V5

Post by rednoah »

:idea: If your --filter is wrong, and excludes all possible matches, then not using a --filter at all is useful for finding the cause of the problem. That's all there is to the help message above. --filter true is effectively the same as not specifying a --filter at all. If FileBot auto-detection is working for the files at hand, then --filter is not necessary, and may break things if the --filter expression is broken.



:arrow: use --filter to exclude specific series IDs:

Code: Select all

--filter 'id !in csv("/path/to/excludes.tsv")'
:!: Note that csv() works best with TAB separated values, and SPACE separated values (i.e. your excludes file sample above uses SPACE as separator) will not work:

Code: Select all

74380	Magnum, P.I. (1980)
72546	CSI: Crime Scene Investigation (2000)
:idea: Please read the FAQ and How to Request Help.
Alfke
Posts: 35
Joined: 24 Jan 2017, 18:11

Re: Filter issue after upgrade to V5

Post by Alfke »

Since my last post, filebot completely broke for me and I had to use the desktop version. I updated to 5.0.1 today and its working again, but the output showed some permission errors so I'll look into that. I'd forgotten how much time filebot saves me by renaming and moving my files all at once.

I'll rename the txt to csv and try using tab values while removing the true filter so my command line will include this: --filter 'id !in csv("//home/plex/excludes.csv")'
Licensed User
Post Reply