Code: Select all
Get-Content "Z:/Movies & TV/_Newly DL'd/Movie Format.groovy" | Select-String -pattern "^.*//+|^\s*$" -notmatch
filebot -script fn:sysenv --format "$FORMAT"
# filebot -script fn:renall "Z:/Movies & TV/_Newly DL'd/_To Process" -non-strict --format "$FORMAT" --db TheMovieDB --action test --log info
Code: Select all
Option "--format" takes an operand
Code: Select all
{n} ({y})_{
def mCFP =
[
'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',
'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 collection = 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 };
};
// call{n} + ' (' + call{y} + ') ' +
call(collection[0].join( ' ' ));
}