Thank you.. I'll be sure to test.

BTW, here's my format so you can see how badly written it is and how it affects the speed
Code: Select all
{
//////////////////////////////////////////////
// MOVIE BINDING
//////////////////////////////////////////////
// Posted here: https://www.filebot.net/forums/viewtopic.php?f=4&t=10766&p=43842#p43842
//////////////////////////////////////////////
def space = call{' '};
// Root Directory
def dir_root = 'Z:\\Movies & TV\\'+
call{hd.matches(/(?i)SD/) ? '1. SD\\' : ' '}+
call{hd.matches(/(?i)HD/) ? '2. HD\\' : ' '}+
call{hd.matches(/(?i)UHD/) ? '3. UHD\\' : ' '};
// Main Title e.g.
// 1408 (2007) (Director's Cut) 1080p HD Blu-ray non-HDR x264 DTS5.1ch_SiNNERS
// 300 (2007) 720p HD BRRip non-HDR x265 DTS 5.1ch_ESiR
// Deadpool (2016) 2160p UHD WEB-DL non-HDR AVC DTS-HD MA 7.1ch_DDR
// Deadpool 2 (2018) (Super Duper Cut) 2160p UHD Blu-ray REMUX HDR10bit ATEME TrueHD Atmos 13Obj 7.1ch_EPSiLON
def main_title = call{n}+
space + '(' + call{y} + ')'+
space + call{fn.matches(/(?i).+\b25th.+?anniv.+/) ? '(25th Anniv. Edition)' : ' '}+
space + call{fn.matches(/(?i).+\b\(limited\b.*?\).+/) ? '(Limited Edition)' : ' '}+
space + call{fn.matches(/(?i).+\b\(uncut\b.*?\).+/) ? '(Uncut)' : ' '}+
space + call{fn.matches(/(?i).+\bcollector.+?s.+?edition\b.+/) ? '(Collector\'s Edition)' : ' '}+
space + call{fn.matches(/(?i).+\bdirect.+?cut\b.+/) ? '(Director\'s Cut)' : ' '}+
space + call{fn.matches(/(?i).+\bextended.+?\b.+/) ? '(Extended)' : ' '}+
space + call{fn.matches(/(?i).+\bextended.+?edit\b.+/) ? '(Extended Edition)' : ' '}+
space + call{fn.matches(/(?i).+\bimax\b.+/) ? '(IMAX Edition)' : ' '}+
space + call{fn.matches(/(?i).+\blimited\b.+/) ? '(Limited)' : ' '}+
space + call{fn.matches(/(?i).+\bremastered\b.+/) ? '(Remastered)' : ' '}+
space + call{fn.matches(/(?i).+\bsuper.+duper.+cut\b.+/) ? '(Super Duper Cut)' : ' '}+
space + call{fn.matches(/(?i).+\btheatrical\b.+/) ? '(Theatrical)' : ' '}+
space + call{fn.matches(/(?i).+\bunrated\b.+/) ? '(Unrated)' : ' '}+
space + call{any{fn.match(/\([^\()+?[^\d]+?\)\s*/)} {' '}{' '}}+
space + call{self.vf ? self.vf : self.hpi}+
space + call{hd}+
space + call{source.matches(/(?i)blu.*ray/) ? 'Blu-ray' : {source} ?: 'WEB-DL'}+
space + call{fn.matches(/(?i).+\bremux\b.+/) ? 'REMUX' : ' '}+
// Only calls {hdr} if it's not SD else non-HDR
space + call{if (hd =~ 'HD') {any{hdr + "-" + bitdepth + 'bit'}{'non-HDR'}}}+
space + call{vc}+
space +
// Call audio
// Thread here where I got the base code from: https://www.filebot.net/forums/viewtopic.php?f=5&t=5285
call {
def mCFP =
[
'AAC LC SBR PS' : 'AAC',
'AAC LC SBR' : 'AAC',
'AAC LC' : 'AAC',
'AC 3 Dep' : 'E-AC3',
'AC 3' : 'AC3',
'DTS 96 24' : 'DTS 96-24',
'DTS ES XBR' : 'DTS-HD HRA',
'DTS ES XLL' : 'DTS-HD MA',
'DTS ES XXCH XBR' : 'DTS-HD HRA',
'DTS ES XXCH XLL' : 'DTS-HD MA',
'DTS ES XXCH' : 'DTS-ES',
'DTS ES' : 'DTS-ES',
'DTS XBR' : 'DTS-HD HRA',
'DTS XLL X' : 'DTS X',
'DTS XLL' : 'DTS-HD MA',
'DTS' : 'DTS',
'E AC 3 JOC' : 'EAC3 Atmos',
'E AC 3' : 'EAC3',
'MLP FBA 16 ch' : 'TrueHD Atmos',
'MLP FBA' : 'TrueHD',
'MP3' : 'MP3',
'MPEG Audio' : 'MP2',
'PCM' : 'PCM'
];
def audioClean = { it.replaceAll(/[\p{Pd}\p{Space}]/, ' ').replaceAll(/\p{Space}{2,}/, ' ').slash(' ') };
def channelClean = { it.replaceAll(/Debug.+|Object\sBased\s?\/?|(\d+)?\sobjects\s\/\s|0.(?=\d.\d)|20/).replaceAll(/6/,'5.1').replaceAll(/8/,'7.1') };
def audioCollection = audio.collect
{ au ->
def channels = any{ channelClean(au['ChannelPositionsString2'])}{ channelClean(au['ChannelsOriginal'])}{ channelClean(au['Channels']) };
def dynChannel = {au['NumberOfDynamicObjects'] + 'Obj'};
def ch = channels.tokenize('\\/').take(3)*.toDouble().inject(0, { a, b -> a + b }).findAll { it > 0 }.max().toString() + 'ch';
def codec = audioClean(any{ au['CodecID/Hint'] }{ au['Format'] });
def format_profile = { ( au['Format_AdditionalFeatures'] != null) ? audioClean(au['Format_AdditionalFeatures']) : '' };
def combined = allOf{codec}{format_profile}.join(' ');
def stream = allOf { mCFP.get(combined, 'UNKNOWN_FORMAT--'+combined+'--') } { dynChannel } { ch };
};
return audioCollection[0].join( ' ' )
} +
'_'+
// Group
call{ any{ fn.match(/(?<=[_-])[^\s_-]+?$/)} {group} {'_NA'} };
// Language
def lang = call{ any{'.'+subt} + {fn.matches(/(?i).+sdh.+/) ? '_SDH' : ''} {any{fn.match(/(?i)\(foreignpartsonly\)/)} '' } };
// Extension
// def ext = call{'.'+ext};
// call all the bindings to create the result
// call(dir_root) +
(call(main_title).replace(':', ';').replace('*', '') + call(lang)).replaceAll(/null/,'')
}