Page 1 of 1

Having problem filtering '$' character

Posted: 10 Jan 2013, 04:25
by belgarth
I'm working on setting up a filter to block the series Title "Vega$", but I am having a problem figuring out how to match against the '$' character:

Input: /home/belgarth/Downloads/Unsorted/Vegas (2012) - S01E11 - Serve, Volley and Kill.mkv
Group: [tvs:Vega$] => [Vegas (2012) - S01E11 - Serve, Volley and Kill.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [Vega$, Vegas]
Fetching episode data for [Vega$]
Fetching episode data for [Vegas]
Fetching episode data for [Vegas]
Fetching episode data for [Vegas (2012)]
Fetching episode data for [Vegas Strip]
Fetching episode data for [Vegas Stripped]
Fetching episode data for [Vegas Confessions]
Fetching episode data for [Vegas: The City the Mob Made]
Apply Filter: {!(n ==~ /Vegas/) && !(n ==~ /Smash Hit/) && !(n ==~ /Smash/) && !(n ==~ /SMASH/) && !(n ==~ /Vega$/)}
...
[MOVE] Rename [/home/belgarth/Downloads/Unsorted/Vegas (2012) - S01E11 - Serve, Volley and Kill.mkv] to [/home/belgarth/Downloads/TV Shows/Vega$/Season 1/Vega$ - S01E11 - Serve, Volley and Kill.mkv]

Is there something needed to switch "!(n ==~ /Vega$/)" to instead to correct filter this out?

Re: Having problem filtering '$' character

Posted: 10 Jan 2013, 06:26
by rednoah
In regex $ means end-of-input so you'll need to escape that to match the literal $, i.e.

Code: Select all

"!(n ==~ /Vega\$/)"
But do you really need to filter this out? Ideally FileBot should be able to pick the right episode even if multiple shows have the same series name.

Re: Having problem filtering '$' character

Posted: 10 Jan 2013, 08:31
by belgarth
That was my first guess, but adding in a regex escape doesn't help, it seems to get ignored:
belgarth@server1:~/bin$ filebot -non-strict -trust-script --conflict override -script "/home/belgarth/bin/utorrent-postprocess.groovy" --filter "!(n ==~ /Vegas/) && !(n ==~ /Smash Hit/) && !(n ==~ /Smash/) && !(n ==~ /SMASH/) && !(n ==~ /Vega\$/)" --output "/home/belgarth/Downloads/" --action copy --conflict override --def subtitles=false artwork=false "ut_dir=/home/belgarth/Downloads/Unsorted" "ut_file=" "ut_kind=" "ut_title=" "ut_label=" "ut_state="
Parameter: subtitles = false
Parameter: artwork = false
Parameter: ut_dir = /home/belgarth/Downloads/Unsorted
Parameter: ut_file =
Parameter: ut_kind =
Parameter: ut_title =
Parameter: ut_label =
Parameter: ut_state =
Input: /home/belgarth/Downloads/Unsorted/Vegas - S01E11.mkv
Group: [tvs:Vega$] => [Vegas - S01E11.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [Vega$, Vegas]
Fetching episode data for [Vega$]
Fetching episode data for [Vegas]
Fetching episode data for [Vegas]
Fetching episode data for [Vegas (2012)]
Fetching episode data for [Vegas Strip]
Fetching episode data for [Vegas Stripped]
Fetching episode data for [Vegas Confessions]
Fetching episode data for [Vegas: The City the Mob Made]
Apply Filter: {!(n ==~ /Vegas/) && !(n ==~ /Smash Hit/) && !(n ==~ /Smash/) && !(n ==~ /SMASH/) && !(n ==~ /Vega$/)}
...
[COPY] Rename [/home/belgarth/Downloads/Unsorted/Vegas - S01E11.mkv] to [/home/belgarth/Downloads/TV Shows/Vega$/Season 1/Vega$ - S01E11 - Serve, Volley and Kill.mkv]
Processed 1 files

Re: Having problem filtering '$' character

Posted: 10 Jan 2013, 10:22
by rednoah
An. The cmdline itself my resolve escaped characters. You could try double escaping, one for cmdline and one for the regex, \\$ or maybe just [$]

PS: Seems it became to smart with the latest update recognising $ as an 's' type character... I'll have a look.

Re: Having problem filtering '$' character

Posted: 11 Jan 2013, 18:46
by rednoah
All cases I tried work, also with both TVRage and TheTVDB I get shows a bit different from your log.

btw here's how I'd write the filter:

Code: Select all

--filter "!(n ==~ /(?i:vega.|smash|smash.hit)/)"