diff --git a/MaNGranA_Pelis.groovy b/MaNGranA_Pelis.groovy index f5ed23d..b0f2f41 100755 --- a/MaNGranA_Pelis.groovy +++ b/MaNGranA_Pelis.groovy @@ -78,6 +78,7 @@ try { //empieza el script : vf def fuente = {try{ source } catch(err){null}}() if (fuente!=null) calidad = calidad.startsWith("micro") ? calidad : vf + /***************************/ /** Formato distribución **/ formato_distribucion = fuente!=null ? fuente : relocation ? '' : @@ -132,17 +133,18 @@ try { //empieza el script try { myFps = ' '+fps.replace(/.0/,'').replace(' ','') }catch(err){} /***************************/ - /* RESULTADO MEDIAINFO */ + /* BLOQUE VIDEO */ def bloqueCalidadVideo = calidad + formato_distribucion def bloqueDescVideo = myBitrate + profundidadColor + myFps + hdr_info def bloqueVideo = ' ['+codecVideo+' '+bloqueCalidadVideo+' '+bloqueDescVideo+']' - + /**********************************************************************************************************/ /** AUDIO (ejecución) **/ def bloqueAudio='' def audiosMap = [:] for (aud in audio) { - def shortDesc = aud.Language_String3 + def shortDesc = aud.Language_String3 !=null ? aud.Language_String3 + : (aud.Title=~/(?i).+spa.+/?'spa': aud.Title.substring(0,3).toLowerCase()) audiosMap[shortDesc] = audiosMap[shortDesc] ?: [:] audiosMap[shortDesc][aud.Format] = audiosMap[shortDesc][aud.Format] ?: [] audiosMap[shortDesc][aud.Format] << aud @@ -174,14 +176,14 @@ try { //empieza el script bloqueAudio += str } groupedAudiosMap=null - bloqueAudio = '['+removeLastComa(bloqueAudio) + bloqueAudio = '['+removeLastComa(bloqueAudio)+']' /***** subtitulos *******/ def bloqueSubs try { def capturedSubs = [:] - bloqueSubs = '][' + bloqueSubs = '[' for (sub in text) handleSub(sub, capturedSubs) for (entry in capturedSubs) bloqueSubs += (entry.value!='null'?entry.value:'und')+', ' bloqueSubs = bloqueSubs.substring(0,bloqueSubs.size()-2)+']' @@ -371,13 +373,13 @@ def getMaxQuality (mapAudioIndexedByFormat) { def printAudio (audio2Print) { def formato_audio = audio2Print.Format_Commercial .replaceAll(/Dolby Digital/, 'Dolby') - .replaceAll(/ Plus/, '+') + .replaceAll(/ Plus/, 'P') .replaceAll(/DTS-HD Master Audio/, 'DTS-MA') - .replaceAll(/DTS-HD High Resolution Audio/, 'DTS-HD-H') + .replaceAll(/DTS-HD High Resolution Audio/, 'DTS-HR') .replaceAll(/MPEG Audio/, 'MPEG') - .replaceAll(/HE-AAC/, 'AAC+') + .replaceAll(/HE-AAC/, 'hAAC') .replaceAll(/ with Dolby Atmos/, 'Atmos') - .replaceAll(/TrueHD/, 'HD') + .replaceAll(/TrueHD/, 'tHD') def canales = audio2Print.Channels.replace(2:'2.0', 6:'5.1', 8:'7.1') return formato_audio + ' ' + canales } @@ -399,15 +401,18 @@ def countAudiosInMap(audMap){ } /********* SUBS ***************/ def handleSub(sub, capturedSubs) { - def lang = sub.Language_String != null ? sub.Language_String : sub.title - def lang3 = sub.Language_String3 != null ? sub.Language_String3 : sub.title + def lang = sub.Language_String3 !=null ? sub.Language_String3 + : (sub.Title=~/(?i).+spa.+/?'spa': sub.Title.substring(0,3).toLowerCase()) + if (sub.Title!=null && sub.Title=~/(?i).*latin.*/) lang='lat' def forced = sub.title!=null ? sub.title.toLowerCase().contains("forzado") : false if (!capturedSubs.containsKey(lang)) { - capturedSubs[lang] = lang3+(forced?'+F':'') + capturedSubs[lang] = lang+(forced?' F':'') } else { def existing=capturedSubs[lang] - if (!existing.contains('+F') && !existing.contains('+')) - capturedSubs[lang] = lang3+(forced?'+F':'+') + def newTxt=''+existing + if (!existing.contains('+')) newTxt += '+' + if (forced && !existing.contains('F')) newTxt += ' F' + capturedSubs[lang]=newTxt.replace(" F+","+F") } } diff --git a/new audio test.groovy b/new audio test.groovy index 748b0ca..214835c 100755 --- a/new audio test.groovy +++ b/new audio test.groovy @@ -1,4 +1,4 @@ - +def skipAudioCheck=true def getAudiosFromListByFormat (format, listAudios) { def result=[] for (singleAudio in listAudios) { @@ -131,7 +131,8 @@ def printAudio (audio2Print) { def bloqueAudio2='' def audiosMap = [:] for (aud in audio) { - def shortDesc = aud.Language_String3 + def shortDesc = aud.Language_String3 !=null ? aud.Language_String3 + : (aud.Title=~/(?i).+spa.+/?'spa': aud.Title.substring(0,3).toLowerCase()) audiosMap[shortDesc] = audiosMap[shortDesc] ?: [:] audiosMap[shortDesc][aud.Format] = audiosMap[shortDesc][aud.Format] ?: [] audiosMap[shortDesc][aud.Format] << aud