Page 1 of 1
Force absolute episode detection
Posted: 06 Dec 2015, 22:15
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?
Re: Force absolute episode detection
Posted: 06 Dec 2015, 22:37
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.
Re: Force absolute episode detection
Posted: 06 Dec 2015, 23:41
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?
Re: Force absolute episode detection
Posted: 07 Dec 2015, 04:21
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
Re: Force absolute episode detection
Posted: 07 Dec 2015, 05:36
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?
Re: Force absolute episode detection
Posted: 07 Dec 2015, 05:53
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.