bona repassada
This commit is contained in:
parent
68997fc469
commit
9d60356ee5
|
@ -23,10 +23,6 @@ def rutaKO = root+"error/"
|
||||||
def skipAudioCheck = true
|
def skipAudioCheck = true
|
||||||
/*************/
|
/*************/
|
||||||
|
|
||||||
/* Excepciones */
|
|
||||||
|
|
||||||
/***************/
|
|
||||||
|
|
||||||
/** Audio (definición) **/
|
/** Audio (definición) **/
|
||||||
def hayEAC3=false
|
def hayEAC3=false
|
||||||
|
|
||||||
|
@ -90,48 +86,6 @@ def printAudio (audio2Print) {
|
||||||
}
|
}
|
||||||
/***********/
|
/***********/
|
||||||
/* otras funciones */
|
/* otras funciones */
|
||||||
def tieneGeneroAnimacion (generos) {
|
|
||||||
for (genero in generos) {
|
|
||||||
if (genero =~ /Anima[c|t]i\p{L}n/)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
def tieneGeneroFamilia (generos) {
|
|
||||||
for (genero in generos) {
|
|
||||||
if (genero =~ /Familia|Family/)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
def tieneGeneroDocumental (generos) {
|
|
||||||
for (genero in generos) {
|
|
||||||
if (genero =~ /Documental|Documentary/)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
def tieneGeneroReality (generos) {
|
|
||||||
for (genero in generos) {
|
|
||||||
if (genero =~ /Reality/)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
def esDocumental (generos, title) {
|
|
||||||
def noJackass = !(title =~ /Jackass/)
|
|
||||||
return (tieneGeneroDocumental(generos) || tieneGeneroReality(generos)) && noJackass
|
|
||||||
}
|
|
||||||
def fromEspPlatform () {
|
|
||||||
def platformES = false
|
|
||||||
try { platformES =
|
|
||||||
info.Network =~ /(?i)\bFLIXOL.\b|\b.?TVE\b/ } catch (ex) {}
|
|
||||||
def companyEs = false
|
|
||||||
try { companyEs =
|
|
||||||
info.ProductionCompanies =~ /.?TVE|ESDIP/ } catch (ex) {}
|
|
||||||
return platformES || companyEs
|
|
||||||
}
|
|
||||||
/**/
|
|
||||||
def getInicial () {
|
def getInicial () {
|
||||||
def nomIngles = localize.English.n
|
def nomIngles = localize.English.n
|
||||||
if (nomIngles.startsWith("The ") || nomIngles.startsWith("A "))
|
if (nomIngles.startsWith("The ") || nomIngles.startsWith("A "))
|
||||||
|
@ -141,19 +95,13 @@ def getInicial () {
|
||||||
def inicial = iniClear.replaceAll(/[0-9]/,'#')+'/'
|
def inicial = iniClear.replaceAll(/[0-9]/,'#')+'/'
|
||||||
return inicial
|
return inicial
|
||||||
}
|
}
|
||||||
|
/***********/
|
||||||
|
|
||||||
try { //empieza el script
|
try { //empieza el script
|
||||||
|
|
||||||
/** Tipo de archivo incorrecto **/
|
/** Tipo de archivo incorrecto **/
|
||||||
def esFicheroMetadatos = false
|
if (ext==~/jpg|nfo|png|url/) {
|
||||||
def tipoMetadato
|
return fn
|
||||||
def nombreWbloqueMediainfo
|
|
||||||
if (ext=="jpg" || ext=="nfo" || ext=="png") {
|
|
||||||
esFicheroMetadatos = true
|
|
||||||
tipoMetadato = fn.find( //coge el contenido que encaja
|
|
||||||
/(?=\-[^-]+$)(.*)(?<!\}|\])$/ )
|
|
||||||
if(tipoMetadato==null)tipoMetadato=''
|
|
||||||
}
|
}
|
||||||
else if (ext!="mkv" && ext!="avi" && ext!="mp4") {
|
else if (ext!="mkv" && ext!="avi" && ext!="mp4") {
|
||||||
throw new Exception("[formato_fichero_noestarndar]")
|
throw new Exception("[formato_fichero_noestarndar]")
|
||||||
|
@ -163,6 +111,11 @@ try { //empieza el script
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Exception("[video_roto]")
|
throw new Exception("[video_roto]")
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
genres
|
||||||
|
} catch (err) {
|
||||||
|
throw new Exception("[genero_no_especificado]")
|
||||||
|
}
|
||||||
/********************************/
|
/********************************/
|
||||||
|
|
||||||
/** Codec Vídeo: en nombre fichero **/
|
/** Codec Vídeo: en nombre fichero **/
|
||||||
|
@ -170,7 +123,7 @@ try { //empieza el script
|
||||||
(any{vc}{0} =~ /264/) ? 'AVC' : vc
|
(any{vc}{0} =~ /264/) ? 'AVC' : vc
|
||||||
/**************/
|
/**************/
|
||||||
|
|
||||||
/******* Calidad: División en carpetas y definición nombre fichero ******/
|
/******* Calidad ******/
|
||||||
def peso = bytes.toString().before(' ').toDouble()
|
def peso = bytes.toString().before(' ').toDouble()
|
||||||
def numericBps = (mbps.toString().before(' ').toDouble()*1000000).round()
|
def numericBps = (mbps.toString().before(' ').toDouble()*1000000).round()
|
||||||
def calidad =
|
def calidad =
|
||||||
|
@ -261,9 +214,6 @@ try { //empieza el script
|
||||||
if (bloqueAudio==null) bloqueAudio = "audio_no_def"
|
if (bloqueAudio==null) bloqueAudio = "audio_no_def"
|
||||||
/***********/
|
/***********/
|
||||||
|
|
||||||
//todo lo demás solo interesa para el fichero que contiene la pelicula
|
|
||||||
//if (esFicheroMetadatos==false) {
|
|
||||||
|
|
||||||
/** Formato distribución **/
|
/** Formato distribución **/
|
||||||
formato_distribucion =
|
formato_distribucion =
|
||||||
fn=~/(?i)\bblu.?ray\b/ ? 'BDRip' :
|
fn=~/(?i)\bblu.?ray\b/ ? 'BDRip' :
|
||||||
|
@ -319,23 +269,6 @@ try { //empieza el script
|
||||||
if (formato_distribucion!='') formato_distribucion=' '+formato_distribucion
|
if (formato_distribucion!='') formato_distribucion=' '+formato_distribucion
|
||||||
/**********************************/
|
/**********************************/
|
||||||
|
|
||||||
/**** Nombre pelicula ****/
|
|
||||||
def nombrePelicula_formatoPlex
|
|
||||||
def tieneQueUsarSpa=true
|
|
||||||
if (tenimCat) {
|
|
||||||
try {
|
|
||||||
if (primaryTitle!=localize.Catalan.n) {
|
|
||||||
tieneQueUsarSpa = false
|
|
||||||
nombrePelicula_formatoPlex = localize.Catalan.plex.name
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
tieneQueUsarSpa=true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (tieneQueUsarSpa)
|
|
||||||
nombrePelicula_formatoPlex = localize.Spanish.plex.name
|
|
||||||
/*************************/
|
|
||||||
|
|
||||||
/**** HDR ********/
|
/**** HDR ********/
|
||||||
def hdr_info=''
|
def hdr_info=''
|
||||||
try{
|
try{
|
||||||
|
@ -388,56 +321,61 @@ try { //empieza el script
|
||||||
def bloqueProfundidad = myBitrate+myFps
|
def bloqueProfundidad = myBitrate+myFps
|
||||||
if (bloqueProfundidad!='' && profundidadColor!='') bloqueProfundidad=' '+bloqueProfundidad
|
if (bloqueProfundidad!='' && profundidadColor!='') bloqueProfundidad=' '+bloqueProfundidad
|
||||||
|
|
||||||
nombreWbloqueMediainfo = nombrePelicula_formatoPlex +' ['+codecVideo+' '+bloqueCalidadVideo+']['+profundidadColor+bloqueProfundidad+']'+' ['+bloqueAudio+']'
|
def bloqueMediainfo = ' ['+codecVideo+' '+bloqueCalidadVideo+']['+profundidadColor+bloqueProfundidad+']'+' ['+bloqueAudio+']'
|
||||||
//+' {imdb-'+imdbid+'}'
|
|
||||||
//}
|
|
||||||
|
|
||||||
/**************************************/
|
/**************************************/
|
||||||
/**** Carpeta / tipo contenido *******/
|
/**** Carpeta / tipo contenido *******/
|
||||||
def generes
|
def tipoYaSeteado=false
|
||||||
def errorNoGenero=false
|
|
||||||
try {generes=genres} catch (err) {errorNoGenero=true}
|
|
||||||
def numPaises = info.ProductionCountries.size()
|
|
||||||
|
|
||||||
def tieneAnimacion = tieneGeneroAnimacion(generes)
|
//animacion (no concluyente)
|
||||||
def tieneFamiliar = tieneGeneroFamilia(generes)
|
def tieneAnimacion = genres.any{ it =~ /Anima.i.n/}
|
||||||
|
//familiar (no conclud)
|
||||||
def esDocu = esDocumental(generes, localize.English.n)
|
def tieneFamiliar = genres.any{ it =~ /Familia|Family/}
|
||||||
|
//docu
|
||||||
|
def esDocu = genres.any{ it =~ /Documental|Documentary|Reality/} && !(title =~ /Jackass/)
|
||||||
|
//anime
|
||||||
def esAnime = false
|
def esAnime = false
|
||||||
|
def numPaises = info.ProductionCountries.size()
|
||||||
if (tieneAnimacion && info.ProductionCountries.contains("JP")) {
|
if (tieneAnimacion && info.ProductionCountries.contains("JP")) {
|
||||||
esAnime = numPaises==1 || anime
|
esAnime = numPaises==1 || anime /*|| country=="JP"*/
|
||||||
}
|
}
|
||||||
|
tipoYaSeteado = esDocu || esAnime
|
||||||
|
|
||||||
//*** española ***
|
//*** española ***
|
||||||
def hispanico = info.ProductionCountries.contains("ES") && (numPaises==1 || (numPaises==2 && info.ProductionCountries.contains("PT")))
|
def espanyola = false
|
||||||
def espanyola = hispanico || fromEspPlatform() || (info.Certifications.size()==1 && info.Certifications.ES!=null)
|
if (!tipoYaSeteado && info.ProductionCountries.contains("ES")) {
|
||||||
//|| ({ try { languages.size()==1 && languages.get(0)=="esp" } catch (Exception e) { null } })()
|
espanyola=
|
||||||
|
(numPaises==1 || (numPaises==2 && info.ProductionCountries.contains("PT")))
|
||||||
|
|| { try { info.Network =~ /(?i)\bFLIXOL.\b|\b.?TVE\b/ } catch (e) { false } }()
|
||||||
|
|| { try { info.ProductionCompanies.any{ it =~ /.?TVE|ESDIP|Canal Sur|Canal\+ España/ } } catch (e) { false } }()
|
||||||
|
|| (info.Certifications.size()==1 && info.Certifications.ES!=null)
|
||||||
|
|| { try { languages.size()==1 && languages.get(0).toString()=~/esp|spa/ } catch (e) { false } }()
|
||||||
|
|| (movie.alternativeTitles.size()==1 && movie.alternativeTitles.ES!=null)
|
||||||
|
|| { try { country=="ES" } catch (e){false} }() && { try { if(languages.size()==1) languages.get(0).toString()!="eng" } catch (e) { false } }()
|
||||||
|
tipoYaSeteado = espanyola
|
||||||
|
}
|
||||||
|
|
||||||
//***** familiar vs infantil ****
|
//***** familiar vs infantil ****
|
||||||
def esFamiliar = tieneFamiliar
|
def esFamiliar = tieneFamiliar
|
||||||
def infantil = false
|
def infantil = false
|
||||||
|
|
||||||
def tipoYaSeteado=esDocu || esAnime
|
|
||||||
if (!tipoYaSeteado) {
|
if (!tipoYaSeteado) {
|
||||||
|
|
||||||
def tieneCertificacion = info.Certifications!=null && info.Certifications.size()!=0
|
def tieneCertificacion = info.Certifications!=null && info.Certifications.size()!=0
|
||||||
|
|
||||||
if (tieneFamiliar && tieneAnimacion) {
|
if (tieneFamiliar && tieneAnimacion) {
|
||||||
def noTanInfantil = info.Certifications.US ==~/PG-13/
|
def noTanInfantil = info.Certifications.US ==~/PG-13/
|
||||||
if (!noTanInfantil)
|
if (!noTanInfantil) infantil = true
|
||||||
infantil = true
|
|
||||||
}
|
}
|
||||||
else if (tieneAnimacion) {
|
else if (tieneAnimacion) {
|
||||||
if (tieneCertificacion) {
|
if (tieneCertificacion) {
|
||||||
if ( info.Certifications.US=="G"
|
infantil = info.Certifications.US=="G"
|
||||||
|| info.Certifications.ES==~/Ai|APTA/
|
|| info.Certifications.ES==~/Ai|APTA/
|
||||||
|| info.Certifications.DE==~/0|6/
|
|| info.Certifications.DE==~/0|6/
|
||||||
|| info.Certifications.IT=="T"
|
|| info.Certifications.IT=="T"
|
||||||
|| info.Certifications.LT=="V" || info.Certifications.RU ==~ /6.+/
|
|| info.Certifications.LT=="V" || info.Certifications.RU ==~ /6.+/
|
||||||
|| info.Certifications.BR=="L"
|
|| info.Certifications.BR=="L"
|
||||||
)
|
|
||||||
infantil=true
|
|
||||||
} else {
|
} else {
|
||||||
def titulosInfantiles = ['Bonnie bears', 'The Jungle Bunch']
|
def titulosInfantiles = ['Bonnie bears', 'The Jungle Bunch']
|
||||||
if (titulosInfantiles.any { localize.English.n.toLowerCase()contains(it.toLowerCase()) })
|
if (titulosInfantiles.any { localize.English.n.toLowerCase()contains(it.toLowerCase()) })
|
||||||
|
@ -450,25 +388,26 @@ try { //empieza el script
|
||||||
esFamiliar = true //posem a familiar pelis de nens que no son animacio
|
esFamiliar = true //posem a familiar pelis de nens que no son animacio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tipoYaSeteado = esFamiliar || infantil
|
||||||
}
|
}
|
||||||
|
|
||||||
//asiaticas
|
//asiaticas
|
||||||
def asiatica = false
|
def asiatica = false
|
||||||
tipoYaSeteado = tipoYaSeteado & (infantil || espanyola)
|
|
||||||
if (!tipoYaSeteado) {
|
if (!tipoYaSeteado) {
|
||||||
//asiaticas
|
//asiaticas
|
||||||
if (numPaises>0) {
|
if (numPaises>0) {
|
||||||
def paisesAsiaticos = ["CN", "HK", "JP", "KP", "KR", "TH", "NP", "TW", "PH", "MO"]
|
def paisesAsiaticos = ["CN", "HK", "JP", "KP", "KR", "TH", "NP", "TW", "PH", "MO"]
|
||||||
|
def languajAsia = ["zho", "kor", "thai", "vie", "jpn", "ind"]
|
||||||
def matchP = paisesAsiaticos.intersect(info.ProductionCountries)
|
def matchP = paisesAsiaticos.intersect(info.ProductionCountries)
|
||||||
def allAsian = matchP.size()==numPaises
|
asiatica = matchP.size() == numPaises
|
||||||
def probableAsian = matchP.size()>0 && englishAudios.isEmpty() && audio.size()>1
|
|| {try { languages.any{ languajAsia.contains(it.toString()) } } catch (err) {false} }()
|
||||||
if (allAsian || probableAsian/*en obseracion*/) asiatica=true
|
//|| matchP.size()>0 && englishAudios.isEmpty() && audio.size()>1 /*en obseracion*/
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//es animacion
|
//es animacion
|
||||||
def esAnimacion = tieneAnimacion && !esFamiliar && !espanyola && !asiatica
|
def esAnimacion = tieneAnimacion && !esFamiliar
|
||||||
|
|
||||||
|
|
||||||
//tria
|
//tria
|
||||||
if (esDocu) ruta = ruta_docu
|
if (esDocu) ruta = ruta_docu
|
||||||
|
@ -484,33 +423,29 @@ try { //empieza el script
|
||||||
/********************************************/
|
/********************************************/
|
||||||
/**************************************/
|
/**************************************/
|
||||||
|
|
||||||
//if (errorNoGenero && ruta!=ruta_classic && ruta!=ruta_retro && !espanyola && !semiEsp && !infantil && ruta!=ruta_estrenos )
|
|
||||||
// throw new Exception("[genero_no_especificado]")
|
/**** Nombre pelicula ****/
|
||||||
|
def nombrePelicula_formatoPlex = {try { primaryTitle!=localize.Catalan.n ? localize.Catalan.plex.name : localize.Spanish.plex.name } catch (err) {localize.Spanish.plex.name} }()
|
||||||
|
/*************************/
|
||||||
|
|
||||||
|
|
||||||
/*** RESULTADO FINAL ***/
|
/*** RESULTADO FINAL ***/
|
||||||
def inicial=''
|
def inicial = (ruta==rutaOK || ruta==ruta_retro) ? getInicial() : ''
|
||||||
|
|
||||||
def inicialsRequerides = ruta==rutaOK || ruta==ruta_retro
|
|
||||||
if (inicialsRequerides) {
|
|
||||||
inicial = getInicial()
|
|
||||||
}
|
|
||||||
def tmdb = " {tmdb-"+tmdbid+"}"
|
def tmdb = " {tmdb-"+tmdbid+"}"
|
||||||
def nomPrincipal = esFicheroMetadatos ? nombreWbloqueMediainfo+tipoMetadato : nombreWbloqueMediainfo
|
def carpetaPeli = localize.Spanish.plex.name + tmdb + '/'
|
||||||
|
def nomPrincipal = nombrePelicula_formatoPlex + bloqueMediainfo
|
||||||
def tracker = fn.find(/(?i)\bHDO(limpo)?\b/)
|
def tracker = fn.find(/(?i)\bHDO(limpo)?\b/)
|
||||||
def extras = tracker != null ? ' ['+tracker.replace("HDOlimpo", "HDO")+']' : ''
|
def extras = tracker != null ? ' ['+tracker.replace("HDOlimpo", "HDO")+']' : ''
|
||||||
def resultado = ruta + //directorios
|
|
||||||
//nombre fichero
|
|
||||||
inicial +
|
|
||||||
localize.English.plex.name + '/' + nomPrincipal + extras + tmdb
|
|
||||||
//(esFicheroMetadatos ? localize.Spanish.plex.name+tipoMetadato : nombreWbloqueMediainfo)
|
|
||||||
|
|
||||||
return resultado
|
return ruta + inicial + carpetaPeli + nomPrincipal + extras + tmdb
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
||||||
|
if (ubuntu_desktop) {
|
||||||
String str= err.getStackTrace().toString()
|
String str= err.getStackTrace().toString()
|
||||||
def pattern = ( str =~ /groovy.(\d+)./ )
|
def pattern = ( str =~ /groovy.(\d+)./ )
|
||||||
return " Error at line number = " + pattern[0][1] + ". more: "+str
|
return " Error at line number = " + pattern[0][1] + ". more: "+str
|
||||||
|
}
|
||||||
|
|
||||||
def rutaMotivoErr
|
def rutaMotivoErr
|
||||||
def msgErr = err.getMessage()
|
def msgErr = err.getMessage()
|
||||||
|
|
|
@ -21,44 +21,8 @@ def rutaKO = root+"error/"
|
||||||
|
|
||||||
/* HARDCODED */
|
/* HARDCODED */
|
||||||
def skipAudioCheck = true
|
def skipAudioCheck = true
|
||||||
def infantilHardCoded = false
|
|
||||||
|
|
||||||
/* otras funciones */
|
/* otras funciones */
|
||||||
def tieneGeneroAnimacion (generos) {
|
|
||||||
for (genero in generos) {
|
|
||||||
if (genero =~ /Anima[c|t]i\p{L}n/)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
def tieneGeneroFamilia (generos) {
|
|
||||||
for (genero in generos) {
|
|
||||||
if (genero =~ /Familia|Family/)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
def tieneGeneroDocumental (generos) {
|
|
||||||
for (genero in generos) {
|
|
||||||
if (genero =~ /Documental|Documentary/)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
def tieneGeneroReality (generos) {
|
|
||||||
for (genero in generos) {
|
|
||||||
if (genero =~ /Reality/)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
def esDocumental (generos, title) {
|
|
||||||
def noJackass = !(title =~ /Jackass/)
|
|
||||||
return (tieneGeneroDocumental(generos) || tieneGeneroReality(generos)) && noJackass
|
|
||||||
}
|
|
||||||
def fromEspPlatform () {
|
|
||||||
return fn.find(/(?i)\bFLIXOL.\b|\bRTVE\b/) != null
|
|
||||||
}
|
|
||||||
/**/
|
/**/
|
||||||
def getInicial () {
|
def getInicial () {
|
||||||
def nomIngles = localize.English.n
|
def nomIngles = localize.English.n
|
||||||
|
@ -91,6 +55,11 @@ try { //empieza el script
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Exception("[video_roto]")
|
throw new Exception("[video_roto]")
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
genres
|
||||||
|
} catch (err) {
|
||||||
|
throw new Exception("[genero_no_especificado]")
|
||||||
|
}
|
||||||
/********************************/
|
/********************************/
|
||||||
|
|
||||||
|
|
||||||
|
@ -150,24 +119,35 @@ try { //empieza el script
|
||||||
|
|
||||||
/**************************************/
|
/**************************************/
|
||||||
/**** Carpeta / tipo contenido *******/
|
/**** Carpeta / tipo contenido *******/
|
||||||
def generes
|
def tipoYaSeteado=false
|
||||||
def errorNoGenero=false
|
|
||||||
try {generes=genres} catch (err) {errorNoGenero=true}
|
|
||||||
|
|
||||||
def tieneAnimacion = tieneGeneroAnimacion(generes)
|
//animacion (no concluyente)
|
||||||
def tieneFamiliar = tieneGeneroFamilia(generes)
|
def tieneAnimacion = genres.any{ it =~ /Anima.i.n/}
|
||||||
|
//familiar (no conclud)
|
||||||
def esDocu = esDocumental(generes, localize.English.n)
|
def tieneFamiliar = genres.any{ it =~ /Familia|Family/}
|
||||||
|
//docu
|
||||||
|
def esDocu = genres.any{ it =~ /Documental|Documentary|Reality/} && !localize.English.n.contains("Jackass")
|
||||||
|
//anime
|
||||||
def esAnime = false
|
def esAnime = false
|
||||||
|
def numPaises = info.ProductionCountries.size()
|
||||||
if (tieneAnimacion && info.ProductionCountries.contains("JP")) {
|
if (tieneAnimacion && info.ProductionCountries.contains("JP")) {
|
||||||
esAnime = info.ProductionCountries.size()==1 || anime
|
esAnime = numPaises==1 || anime /*|| country=="JP"*/
|
||||||
}
|
}
|
||||||
|
tipoYaSeteado = esDocu || esAnime
|
||||||
|
|
||||||
|
//*** española ***
|
||||||
|
def espanyola = tipoYaSeteado
|
||||||
|
|| info.ProductionCountries.contains("ES") && (numPaises==1 || (numPaises==2 && info.ProductionCountries.contains("PT")))
|
||||||
|
|| { try { info.Network =~ /(?i)\bFLIXOL.\b|\b.?TVE\b/ } catch (e) { false } }()
|
||||||
|
|| { try { info.ProductionCompanies.any{ it =~ /.?TVE|ESDIP|Canal Sur|Canal\+ España/ } } catch (e) { false } }()
|
||||||
|
|| (info.Certifications.size()==1 && info.Certifications.ES!=null)
|
||||||
|
|| { try { languages.size()==1 && languages.get(0).toString()=="esp" } catch (e) { false } }() || (movie.alternativeTitles.size()==1 && movie.alternativeTitles.ES!=null)
|
||||||
|
|| { try { country=="ES" } catch (e){false} }() && { try { if(languages.size()==1) languages.get(0).toString()!="eng" } catch (e) { false } }()
|
||||||
|
tipoYaSeteado = tipoYaSeteado || espanyola
|
||||||
|
|
||||||
//***** familiar vs infantil ****
|
//***** familiar vs infantil ****
|
||||||
def esFamiliar = tieneFamiliar
|
def esFamiliar = tieneFamiliar
|
||||||
def infantil = false
|
def infantil = false
|
||||||
|
|
||||||
def tipoYaSeteado=esDocu || esAnime
|
|
||||||
if (!tipoYaSeteado) {
|
if (!tipoYaSeteado) {
|
||||||
|
|
||||||
def tieneCertificacion = info.Certifications!=null && info.Certifications.size()!=0
|
def tieneCertificacion = info.Certifications!=null && info.Certifications.size()!=0
|
||||||
|
@ -199,44 +179,39 @@ try { //empieza el script
|
||||||
esFamiliar = true //posem a familiar pelis de nens que no son animacio
|
esFamiliar = true //posem a familiar pelis de nens que no son animacio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tipoYaSeteado = tipoYaSeteado || infantil
|
||||||
}
|
}
|
||||||
|
|
||||||
//espanyoles & asiaticas
|
|
||||||
def espanyola = false
|
|
||||||
def asiatica = false
|
|
||||||
tipoYaSeteado=esDocu || esAnime || esFamiliar || infantil
|
|
||||||
if (!tipoYaSeteado) {
|
|
||||||
|
|
||||||
def segurEsp = info.ProductionCountries.contains("ES") && info.ProductionCountries.size()==1
|
|
||||||
espanyola = fromEspPlatform() || segurEsp
|
|
||||||
|
|
||||||
//asiaticas
|
//asiaticas
|
||||||
if (!espanyola && info.ProductionCountries.size()>0) {
|
def asiatica = false
|
||||||
|
if (!tipoYaSeteado) {
|
||||||
|
//asiaticas
|
||||||
|
if (numPaises>0) {
|
||||||
def paisesAsiaticos = ["CN", "HK", "JP", "KP", "KR", "TH", "NP", "TW", "PH", "MO"]
|
def paisesAsiaticos = ["CN", "HK", "JP", "KP", "KR", "TH", "NP", "TW", "PH", "MO"]
|
||||||
def matchP = paisesAsiaticos.intersect(info.ProductionCountries)
|
def matchP = paisesAsiaticos.intersect(info.ProductionCountries)
|
||||||
def allAsian = matchP.size()==info.ProductionCountries.size()
|
def allAsian = matchP.size()==numPaises
|
||||||
def probableAsian = matchP.size()>0 && englishAudios.isEmpty() && audio.size()>1
|
def probableAsian = matchP.size()>0 && englishAudios.isEmpty() && audio.size()>1
|
||||||
if (allAsian || probableAsian/*en obseracion*/) asiatica=true
|
if (allAsian || probableAsian/*en obseracion*/) asiatica=true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//es animacion
|
||||||
|
def esAnimacion = tieneAnimacion && !esFamiliar
|
||||||
|
|
||||||
//tria
|
//tria
|
||||||
if (esDocu) ruta = ruta_docu
|
if (esDocu) ruta = ruta_docu
|
||||||
else if (esAnime) ruta = ruta_anime
|
else if (esAnime) ruta = ruta_anime
|
||||||
else if (infantil) ruta = ruta_infantil
|
else if (infantil) ruta = ruta_infantil
|
||||||
else if (esFamiliar) ruta = ruta_familiar
|
else if (esAnimacion) ruta = ruta_animacion
|
||||||
else if (tieneAnimacion) ruta = ruta_animacion
|
|
||||||
else if (asiatica) ruta = ruta_asiaticas
|
|
||||||
else if (espanyola) ruta = ruta_esp
|
else if (espanyola) ruta = ruta_esp
|
||||||
|
else if (esFamiliar) ruta = ruta_familiar
|
||||||
|
else if (asiatica) ruta = ruta_asiaticas
|
||||||
else if (y<1980) ruta = ruta_classic
|
else if (y<1980) ruta = ruta_classic
|
||||||
else if (y<2000) ruta = ruta_retro
|
else if (y<2000) ruta = ruta_retro
|
||||||
if (ruta==rutaOK && y>=2021) ruta = ruta_estrenos
|
if (ruta==rutaOK && y>=2021) ruta = ruta_estrenos
|
||||||
/********************************************/
|
/********************************************/
|
||||||
/**************************************/
|
/**************************************/
|
||||||
|
|
||||||
//if (errorNoGenero && ruta!=ruta_classic && ruta!=ruta_retro && !espanyola && !semiEsp && !infantil && ruta!=ruta_esp_retro && ruta!=ruta_esp_classic && ruta!=ruta_estrenos )
|
|
||||||
// throw new Exception("[genero_no_especificado]")
|
|
||||||
|
|
||||||
/*** RESULTADO FINAL ***/
|
/*** RESULTADO FINAL ***/
|
||||||
def inicial=''
|
def inicial=''
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue