Remove prefix before searching

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
otr
Posts: 11
Joined: 06 Aug 2018, 20:37

Remove prefix before searching

Post by otr »

Hello,

Files downloaded from the software archive have sanet.st appended as prefix. Filebot then fails to match that.
Could this prefix be added to the global list of ignored phrases?
Or, if not possible, what would be the right way to ignore the phrase with filebot node?

Thanks!

Code: Select all

Parameter: clean = y
Parameter: skipExtract = y
Parameter: excludeList = .excludes
Argument[0]: /volume1/Downloads
Use excludes: /volume1/Media/.excludes
Ignore system path: /volume1/Downloads/#recycle
Ignore system path: /volume1/Downloads/@eaDir

Input: /volume1/Downloads/sanet.st_Greys.Anatomy.S19E11.Training.Day.1080p.AMZN.WEB-DL.DDP5.1.H.264-NTb.mkv
Group: {Series=sanet st Greys Anatomy} => [sanet.st_Greys.Anatomy.S19E11.Training.Day.1080p.AMZN.WEB-DL.DDP5.1.H.264-NTb.mkv]
Group: {Series=Sanet st Greys Anatomy} => 
Rename episodes using [TheMovieDB] with [Airdate Order]
Lookup via [] [sanet st Greys Anatomy]
No episode data found: [sanet st Greys Anatomy]
Failed to identify or process any files
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Remove prefix before searching

Post by rednoah »

Thanks for reporting the issue. I've added sanet.st to the list.


:arrow: In the meanwhile you can use the --q option to force a specific query:

Code: Select all

--q "Greys Anatomy"
:arrow: Alternatively, you can also dynamically extract the query from the file name with your own custom code:
viewtopic.php?t=12043


:idea: The FileBot Node WebUI field corresponding to --q is Query Expression.
:idea: Please read the FAQ and How to Request Help.
otr
Posts: 11
Joined: 06 Aug 2018, 20:37

Re: Remove prefix before searching

Post by otr »

Thank you!
dgnrt3
Posts: 26
Joined: 21 Apr 2023, 19:58

Re: Remove prefix before searching

Post by dgnrt3 »

You could also work with regex to strip letters or numbers at the front of the name followed by an underscore:

Code: Select all

^\w+_
a possible query would like this:

Code: Select all

--q "{fn.replaceAll(/(?i:(^\w+_|\d{3,4}p|-\w*$))/,'')}"
  • ^\w+_ = any amount of letters or numbers at the start of the filename followed by underscore
  • \d{3,4}p = letter p prefixed by 3 or 4 numbers
  • -\w*$ = any amount of letters or numbers at the end of the filename prefixed by a dash
otr
Posts: 11
Joined: 06 Aug 2018, 20:37

Re: Remove prefix before searching

Post by otr »

Interesting. Where would that query go? I call filebot automatically from Jdownloader via a batch (sh) script, when then calls the AMC script as parameter.

So would this query go into the batch that calls filebot?
dgnrt3
Posts: 26
Joined: 21 Apr 2023, 19:58

Re: Remove prefix before searching

Post by dgnrt3 »

this query goes to your selected DB (TheTVDB, MovieDB, AniDB, etc). You can integrate this into the query your script calls
otr
Posts: 11
Joined: 06 Aug 2018, 20:37

Re: Remove prefix before searching

Post by otr »

My script essentially just calls the AMC script, with something like this:

Code: Select all

filebot -script fn:amc --output "X:/Media" --action duplicate --conflict skip -non-strict --log-file amc.log --def excludeList=amc.excludes --def unsorted=y music=y artwork=y "ut_label=%L" (…)
Where would this go here? Is there still space, our would I need to put it into the amc script itself, which of course I don’t have?
Post Reply