I have written a script to group and collect audio track info, however i found out that renaming preview and effective preview do not match and It's driving me crazy.
below my code
Groovy: Select all
{
String audioToString(){
def myAudioList = []
for (int i = 0; i < audio.format.size(); i++) {
def track = [:]
track.format = audio.format[i].toString().removeAll(/[^A-Z0-9]/)
track.channels = audio.channels[i].replaceAll(/\[|]/,'').replace('2', '2.0').replace('6', '5.1')
track.language = audio.LanguageString3[i] != null ? audio.LanguageString3[i].lower() : "und"
myAudioList << track
}
def groupedAudio = myAudioList.groupBy { "${it.format} ${it.channels}" }
def result = []
groupedAudio.each { key, tracks ->
def languages = ""
tracks.eachWithIndex { track, index ->
languages += track.language
if (index < tracks.size() - 1) {
languages += " "
}
}
result << "${languages} ${key}"
}
return result.join(" ")
}
}

But what it really renames is

as you see the codec changes from AC3 to EAC3 for no apparent reason, the thing is done randomly on other files as well
any help?