Page 1 of 1

Remove prefix before searching

Posted: 31 Mar 2023, 17:46
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

Re: Remove prefix before searching

Posted: 01 Apr 2023, 03:57
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.

Re: Remove prefix before searching

Posted: 01 Apr 2023, 11:25
by otr
Thank you!

Re: Remove prefix before searching

Posted: 24 Apr 2023, 08:44
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

Re: Remove prefix before searching

Posted: 24 Apr 2023, 10:36
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?

Re: Remove prefix before searching

Posted: 24 Apr 2023, 11:01
by dgnrt3
this query goes to your selected DB (TheTVDB, MovieDB, AniDB, etc). You can integrate this into the query your script calls

Re: Remove prefix before searching

Posted: 24 Apr 2023, 11:17
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?