How to use --filter?

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
cowboytronic
Posts: 3
Joined: 13 Mar 2017, 06:27

How to use --filter?

Post by cowboytronic »

This is very helpful!

I had a problem with one short series (only 9 episodes) matching multiple series in the rename.

The show is called "Profit" (a 1996 show) but some episodes were matching a different show called "The Profit" (a 2013 show)

Code: Select all

root@0ba7c9b32e04:/input/tv# filebot -rename Profit/* --q "Profit" -non-strict --db thetvdb --action test --format "{plex} [{vf}, {vc}, {ac}, {af}]" --output=/output
Rename episodes using [TheTVDB]
Fetching episode data for [The Profit]
Fetching episode data for [Profit]
Fetching episode data for [Profiling]
Fetching episode data for [Profiler]
[TEST] Rename [/input/tv/Profit/Profit - Complete Series/Profit.S01E01-02.DVDRIP.XVID - Pilot.avi] to [/output/TV Shows/The Profit/Season 01/The Profit - S01E01-E02 - Car Cash & Maarse Florist [360p, XviD, MP3, 2ch].avi]
[TEST] Rename [/input/tv/Profit/Profit - Complete Series/Profit.S01E03.DVDRIP.XVID - Hero.avi] to [/output/TV Shows/The Profit/Season 01/The Profit - S01E03 - Planet Popcorn [360p, XviD, MP3, 2ch].avi]
[TEST] Rename [/input/tv/Profit/Profit - Complete Series/Profit.S01E04.DVDRIP.XVID - Sykes.avi] to [/output/TV Shows/The Profit/Season 01/The Profit - S01E04 - Eco-Me [480p, XviD, MP3, 2ch].avi]
[TEST] Rename [/input/tv/Profit/Profit - Complete Series/Profit.S01E05.DVDRIP.XVID - Healing.avi] to [/output/TV Shows/The Profit/Season 01/The Profit - S01E05 - LA Dogworks [480p, XviD, MP3, 2ch].avi]
[TEST] Rename [/input/tv/Profit/Profit - Complete Series/Profit.S01E06.DVDRIP.XVID - Cupid.avi] to [/output/TV Shows/The Profit/Season 01/The Profit - S01E06 - Mr. Green Tea [360p, XviD, MP3, 2ch].avi]
[TEST] Rename [/input/tv/Profit/Profit - Complete Series/Profit.S01E07.DVDRIP.XVID - Chinese Box.avi] to [/output/TV Shows/Profit/Season 01/Profit - S01E07 - Chinese Box [480p, XviD, MP3, 2ch].avi]
[TEST] Rename [/input/tv/Profit/Profit - Complete Series/Profit.S01E08.DVDRIP.XVID - Security.avi] to [/output/TV Shows/Profit/Season 01/Profit - S01E08 - Security [480p, XviD, MP3, 2ch].avi]
[TEST] Rename [/input/tv/Profit/Profit - Complete Series/Profit.S01E09.DVDRIP.XVID - Forgiveness.avi] to [/output/TV Shows/Profit/Season 01/Profit - S01E09 - Forgiveness [480p, XviD, MP3, 2ch].avi]
Processed 8 files
This is a one-time job, so I just added a filter to the rename command, rather than create an exclude file. I put into the filter all of the show names that the TheTVDB query matched.

Code: Select all

--filter "n != /The Profit/ && n != /Profiling/ && n != /Profiler/"
This fixed the issue, and all episodes matched the correct show

Code: Select all

root@0ba7c9b32e04:/input/tv# filebot -rename Profit/* --q "Profit" -non-strict --db thetvdb --filter "n != /The Profit/ && n != /Profiling/ && n != /Profiler/" --action test --format "{plex} [{vf}, {vc}, {ac}, {af}]" --output=/output
Rename episodes using [TheTVDB]
Fetching episode data for [The Profit]
Fetching episode data for [Profit]
Fetching episode data for [Profiling]
Fetching episode data for [Profiler]
Apply Filter: {n != /The Profit/ && n != /Profiling/ && n != /Profiler/}
Include [Profit - 1x01 - Pilot (1)]
Include [Profit - 1x02 - Pilot (2)]
Include [Profit - 1x03 - Hero]
Include [Profit - 1x04 - Sykes]
Include [Profit - 1x05 - Healing]
Include [Profit - 1x06 - Cupid]
Include [Profit - 1x07 - Chinese Box]
Include [Profit - 1x08 - Security]
Include [Profit - 1x09 - Forgiveness]
[TEST] Rename [/input/tv/Profit/Profit - Complete Series/Profit.S01E01-02.DVDRIP.XVID - Pilot.avi] to [/output/TV Shows/Profit/Season 01/Profit - S01E01-E02 - Pilot [360p, XviD, MP3, 2ch].avi]
[TEST] Rename [/input/tv/Profit/Profit - Complete Series/Profit.S01E03.DVDRIP.XVID - Hero.avi] to [/output/TV Shows/Profit/Season 01/Profit - S01E03 - Hero [360p, XviD, MP3, 2ch].avi]
[TEST] Rename [/input/tv/Profit/Profit - Complete Series/Profit.S01E04.DVDRIP.XVID - Sykes.avi] to [/output/TV Shows/Profit/Season 01/Profit - S01E04 - Sykes [480p, XviD, MP3, 2ch].avi]
[TEST] Rename [/input/tv/Profit/Profit - Complete Series/Profit.S01E05.DVDRIP.XVID - Healing.avi] to [/output/TV Shows/Profit/Season 01/Profit - S01E05 - Healing [480p, XviD, MP3, 2ch].avi]
[TEST] Rename [/input/tv/Profit/Profit - Complete Series/Profit.S01E06.DVDRIP.XVID - Cupid.avi] to [/output/TV Shows/Profit/Season 01/Profit - S01E06 - Cupid [360p, XviD, MP3, 2ch].avi]
[TEST] Rename [/input/tv/Profit/Profit - Complete Series/Profit.S01E07.DVDRIP.XVID - Chinese Box.avi] to [/output/TV Shows/Profit/Season 01/Profit - S01E07 - Chinese Box [480p, XviD, MP3, 2ch].avi]
[TEST] Rename [/input/tv/Profit/Profit - Complete Series/Profit.S01E08.DVDRIP.XVID - Security.avi] to [/output/TV Shows/Profit/Season 01/Profit - S01E08 - Security [480p, XviD, MP3, 2ch].avi]
[TEST] Rename [/input/tv/Profit/Profit - Complete Series/Profit.S01E09.DVDRIP.XVID - Forgiveness.avi] to [/output/TV Shows/Profit/Season 01/Profit - S01E09 - Forgiveness [480p, XviD, MP3, 2ch].avi]
Processed 8 files
Now, I could have renamed them manually, but now I know how to fix this issue on much larger batch jobs for longer series.

Thanks for adding this feature!
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: --filter and fine-tuning

Post by rednoah »

1.
cowboytronic wrote:The show is called "Profit" (a 1996 show) but some episodes were matching a different show called "The Profit" (a 2013 show)
In this case, this --filter will work just as well, and matches your intent much better:

Code: Select all

--filter "y == 1996"
or

Code: Select all

--filter "n == /The Profit/"

2.
You'll probably prefer console-interactive mode for one-off tasks though:
viewtopic.php?f=3&t=4398

Image
:idea: Please read the FAQ and How to Request Help.
cowboytronic
Posts: 3
Joined: 13 Mar 2017, 06:27

Re: --filter and fine-tuning

Post by cowboytronic »

Thanks for the tip on the year filter, that's even simpler, and worked when I was trying to rename "Life on Mars" (original UK version) which was getting matched to the US version.

The interactive mode is fantastic! For my one-off tasks of cleaning up old archives, it's really helping me not have to trial-and-error lots of flags in test mode.
Post Reply