Is it possible to keep all the language versions of subtitles?
Some files arrive with english_2, english_3, english_9 etc
I would be very happy is it could be named accordingly....
Code: Select all
Movie Name (2021) - [1080p x265 AAC 5.1] [BluRay]
Movie Name (2021) - [1080p x265 AAC 5.1] [BluRay].eng(1)
Movie Name (2021) - [1080p x265 AAC 5.1] [BluRay].eng(2)
Movie Name (2021) - [1080p x265 AAC 5.1] [BluRay].fre(1)
Movie Name (2021) - [1080p x265 AAC 5.1] [BluRay].fre(2)
I use emby and it will happily work with this format unless anyone know a better way.
Thank you in advance for any help
My current format....
Code: Select all
\\192.168.0.160\Multimedia/Movies/{f =~ /(?i)3D|3\.D|3\-D/ ? '3D Movies' : vf =~ /2160p/ ? '4K Movies' : 'Movies'}/{AZ}/
{ny}
/{ny} - [{vf} {vc} {hdr}
{
def codecList =
[
'MP3' : 'MP3',
'PCM' : 'PCM',
'AAC LC' : 'AAC',
'AAC LC SBR' : 'AAC',
'AC 3' : 'AC3',
'AC 3 Dep' : 'EAC3',
'E AC 3' : 'EAC3',
'E AC 3 JOC' : 'EAC3 Atmos',
'E-AC-3 JOC' : 'EAC3 Atmos',
'DTS' : 'DTS',
'DTS 96 24' : 'DTS 96-24',
'DTS ES' : 'DTS-ES',
'DTS ES XXCH' : 'DTS-ES',
'DTS XBR' : 'DTS-HD HRA',
'DTS ES XBR' : 'DTS-HD HRA',
'DTS ES XXCH XBR' : 'DTS-HD HRA',
'DTS XLL' : 'DTS-HD MA',
'DTS ES XLL' : 'DTS-HD MA',
'DTS ES XXCH XLL' : 'DTS-HD MA',
'DTS XLL X' : 'DTS X',
'MLP FBA' : 'Dolby TrueHD',
'MLP FBA 16 ch' : 'Dolby Atmos'
]
def filter = { [it.codec, it.ch, it.objects, it.lang] }
def audioStreams = []
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.0/,'5.1').replaceAll(/8.0/,'7.1')}
def oneStream = { it.collect{ filter(it) }*.minus(null).unique().flatten().join(' ') }
def dString = { it.toDouble().toString() }
def toInt = { it.toInteger() }
audio.collect{ au ->
def codec = audioClean(any{ au['CodecID/Hint'] }{ au['Format'] })
def format_profile = any{ audioClean(au['Format_AdditionalFeatures'])}{}
def String ch = any{ channelClean(au.ChannelPositionsString2).tokenize('\\/')*.toDouble().toString().sum() }
{ channelClean(dString(au.ChannelsOriginal)) } { channelClean(dString(au.Channels)) }
def chFilter = (( ( (ac == 'AAC'||ac == 'MP3') && ch != '2.0') || ( (ac == 'AC3'||ac == 'EAC3'||ac == 'DTS'||ac == 'TrueHD'||ac == 'MLPFBA') && ch != '5.1' ) ) ? ch : null)
def combined = allOf{codec}{format_profile}.join(' ')
audioStreams << ['index' : codecList.findIndexOf {it.key == combined}, 'default' : au['default'][0].toBoolean(),
'codec' : codecList.get(combined, 'UNKNOWN_FORMAT'), 'combined' : combined, 'ch' : ch,
'bitrate' : any{toInt(au.BitRate)}{toInt(au.BitRate_Maximum)}{au.FrameRate.toDouble()}{null}]
return audioStreams
}
def allStreams = audioStreams.collect{ filter(it) }*.minus(null).unique()*.join(' ')
def preferredStream = oneStream(audioStreams.findAll{ it.index == audioStreams.index.max() })
def bestBitRate = oneStream(audioStreams.findAll{ it.bitrate == audioStreams.bitrate.max() })
def defaultStream = oneStream(audioStreams.findAll{it.default == true})
allStreams.join(' ').space(' ')
preferredStream.space(',')
defaultStream.space(' ')
bestBitRate.space(' ')
[bestBitRate, preferredStream].unique().join(' ')
}] {[source]}{subt}