devster wrote: ↑22 Jan 2018, 23:03
I added
.take(3) after the tokenize.
Code: Select all
{ import java.math.RoundingMode
import net.filebot.Language
// map Codec + Format Profile
def mCFP = [ "AC3" : "AC3",
"AC3+" : "E-AC3",
"AAC LC LC" : "AAC-LC",
"AAC LC SBR HE AAC LC" : "HE-AAC" ]
def audioClean = { it.replaceAll(/[\p{Pd}\p{Space}]/, ' ').replaceAll(/\p{Space}{2,}/, ' ') }
audio.collect { au ->
def channels = any{ au['ChannelPositions/String2'] }{ au['Channel(s)_Original'] }{ au['Channel(s)'] }
def ch = channels.replaceAll(/Object\sBased\s\/|0.(?=\d.\d)/, '')
.tokenize('\\/').take(3)*.toDouble()
.inject(0, { a, b -> a + b }).findAll { it > 0 }
.max().toBigDecimal().setScale(1, RoundingMode.HALF_UP).toString()
def codec = audioClean(any{ au['CodecID/String'] }{ au['Codec/String'] }{ au['Codec'] })
def format = any{ au['CodecID/Hint'] }{ au['Format'] }
def format_profile = { if ( au['Format_Profile'] != null) audioClean(au['Format_Profile']) else '' }
def combined = allOf{codec}{format_profile}.join(' ')
def stream = allOf
{ ch }
{ mCFP.get(combined, format) }
{ Language.findLanguage(au['Language']).ISO3.upperInitial() }
return stream }*.join(" ").join(", ") }
the audio map is incomplete (work in progress).
How am I supposed to run this script?
I just installed Filebot for the first time and am a little confused.
So far I have:
Code: Select all
filebot -rename "G:\Meine Ablage\Plexy\DOWNLOAD\Black.Swan.2010.German.DTS.DL.1080p.BluRay.AVC.Remux-iNCEPTiON" --output "G:\Meine Ablage\Plexy\DOWNLOAD\Black.Swan.2010.German.DTS.DL.1080p.BluRay.AVC.Remux-iNCEPTiON" --format "{n.upperInitial().space('.')}.({y}).{'['+source+']'}{'['+vf+']'}{'['+ac+']'}{'['+channels+']'}{'['+vc.replace('Microsoft', 'VC-1')+']'}{any{n.findMatch(group) ? null : '-'+group}{'-'+fn.match(/(?<=[-])\w+$/)}}" --action test
Now I'd like to combine it with your script, so I get better details for audio. But I'm unable to find out how to insert your script.
Is this a groovy file, a arguments file or simple arguments (which would make it unreadable, cause of it's length

) I tried all of those methods, probably just wrong, but none worked.

I'm sorry for the silly question.
