Force absolute episode detection

All your suggestions, requests and ideas for future development
Post Reply
cowmix
Power User
Posts: 30
Joined: 09 Jan 2015, 11:03

Force absolute episode detection

Post by cowmix »

Code: Select all

rename(file:files.sort(), action:'hardlink', format:files.get(0).parent + '/.scratch/{n} -  {[e.pad(5)]} - {t} - {[d]}', query:animeTitle, db:'AniDB', order:'absolute', filter:'episode.season == null && episode.special == null', strict:false)
I'm trying to reformat some files I know are using absolute numbering, is there a way to force the parser to read 101 as episode 101 instead of season 1 and episode 1? Episodes 1 - 99 detect properly as absolute and higher 100's also don't seem to have the issue.

I know the order parameter is specifying how the reaming episode formatting and filter only seems to effect grabbing the source episode list but is there a way to tell the parser during rename that these files are already in absolute order and do not try to parse a season number?
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Force absolute episode detection

Post by rednoah »

1.
FileBot interprets numbers like 101 as BOTH S01E01 and E101 so by using absolute sort order you can make sure that the E101 interpretation will end up making the most sense.

2.
If you use E101 in the filename then that'll not be interpreted as S01E01.
:idea: Please read the FAQ and How to Request Help.
cowmix
Power User
Posts: 30
Joined: 09 Jan 2015, 11:03

Re: Force absolute episode detection

Post by cowmix »

Ok cool I ended up doing

Code: Select all

files = rename(file:files.sort(), action:'hardlink', format:files.get(0).parent + '/.scratch/{fn.replaceAll(/(?<!\\])(?!\\[)(\\d{3})/, "E\\$1")}', query:animeTitle, db:'AniDB', order:'absolute')
first before passing the files to the TheTVDB for further renaming. Is there a basic db I can use for filename renaming when I don't need any special media information?
Last edited by cowmix on 07 Dec 2015, 05:15, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Force absolute episode detection

Post by rednoah »

1.
Yes, but --db xattr will only works for files that have previously been processed by filebot and are xattr tagged with all the meta information. The CLI doesn't have an equivalent to the "Generic File" mode the GUI has.

2.
I recommend pre-processing target files with this script: viewtopic.php?f=4&t=5#p2100
:idea: Please read the FAQ and How to Request Help.
cowmix
Power User
Posts: 30
Joined: 09 Jan 2015, 11:03

Re: Force absolute episode detection

Post by cowmix »

how does the action variable work in that script? I see the action get set but it doesn't seem to be used anywhere? Is it just setting a default action for all renames?
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Force absolute episode detection

Post by rednoah »

I guess that's just some old code that doesn't do anything...
https://github.com/filebot/scripts/comm ... 64a984f8eb

The rename(map) call inherits the --action option just like all the other rename(...) calls.
:idea: Please read the FAQ and How to Request Help.
Post Reply