cortx, here's the format I use for my movies...
Code: Select all
{
def vol="P", drive="01", drives="01|02|03|04|05|35|43|44"
def releaseType='', replaceFinds="CGI", collectionsFolder="_", collectionsFile="P:/collections.txt", alt="wolf"
def year=y, name=n.removeAll(/\s*\(\d{4}\)$/).colon(' - ').validateFileName(), group=any{group}{any{original}{fn}.match(/(?:-)([a-z\d]{1,15})$/)}{}
def sub=any{"${collectionsFolder}/${any{readLines(collectionsFile).find{it=~imdbid}.after(':').before(/[:#\t*]/)}{collection}.replaceAll(/(\s(${replaceFinds})\s)/,' ').colon(" - ").validateFileName()}"}{}
def root="${vol}:\\_${any{file.path.match(/(?<=^${vol}:?(\\dev)?\\_)(${drives})(?=\\)/)}{drive}}${any{file.path.match(/(\/${alt}\//)}{'/'}}"
def releaseInfo(text) { return text.removeAll(/(${text.stripReleaseInfo().replaceAll(/ /,'.+')})[.)]*/).removeAll(/(^|\.)\[?[\da-f]{8}\]?/) }
def release=allOf{allOf{source.upper()}{vf}{hd}{vc.match(/(hevc|[xh]\.?26\d)/).replaceAll(/[xh]\.?265/,'HEVC')}{bitdepth+"bit"}{ac}.join('.')}{group}.join('-')
def releases=[file:releaseInfo(fn), original:any{releaseInfo(original)}{}]
def part=any{fn.lower().find(/(?<=[. ](part|cd)[. ]?)\d+(?=[. ]|$)/)}{original.lower().find(/(?<=[. ](part|cd)[. ]?)\d+(?=[. ]|$)/)}
def path=[
movie: "MOVIES",
sub: any{sub}{az}{n.match(/^(?:the|a )?.*?([\da-z])/).replaceAll(/\d/,"0-9")},
folder: (sub?"${year} - ${name}":"${name} (${year})"),
file: allOf{allOf{"${name} (${year})"}{any{releases[releaseType]}{release}}{"(CD".concat(part)+")"}{"[${crc32}]"}{"CD".concat(part)}.join('.')}{subt}.join()
]
return allOf{root}{path.values().join('/')}.join('/')
}
I'll explain some of it:
I use "P:" drive as my Plex drive, and have Junction points to folders on other drives linked in the root of "P:"
A couple of examples of root movie folders are "P:\_01\Movies" and "P:\_02\Movies." The folders "_01" and "_02" are the junction points I was talking about, and they lead to a folder named "MEDIA" on the root of other drives. The list of two digit numbers you see "01|02|03|etc" are valid junctions that can be used.
The part that should be of particular interest to you is this:
Code: Select all
name=n.removeAll(/\s*\(\d{4}\)$/).colon(' - ').validateFileName()
rednoah told me about that little gem a couple of years back. '.validateFileName()' will take the filename and make sure it's valid by stripping (or replacing?) any illegal character for the file system in use. As you can see, I'm also using the '.colon()' option to change colons to something more appropriate, but even without it, it wouldn't cause an issue.
If you decide to give the above code a try, then if you have a static root path that you pass along to filebot when calling on it, be sure to change the last line to this:
If you don't, then it will include a drive letter as part of the structure, causing issues. Either supply it via parameter to filebot, or via format, but not both.