intensive afternoon
This commit is contained in:
parent
a0f2540003
commit
68997fc469
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
._.DS_Store
|
||||||
|
._MaNGranA_Pelis_Organizer.groovy
|
||||||
|
.DS_Store
|
|
@ -1,7 +1,8 @@
|
||||||
//by @xeviff
|
//by @xeviff
|
||||||
/** RUTAS **/
|
/** RUTAS **/
|
||||||
def inicialsActivades=true
|
def ubuntu_desktop=false
|
||||||
def root = '/pelis/'
|
|
||||||
|
def root = ubuntu_desktop ? '/mnt/mangrana_pelis/' : '/pelis/'
|
||||||
def rutaOK = root+"Pelis/plain/"
|
def rutaOK = root+"Pelis/plain/"
|
||||||
def ruta = rutaOK
|
def ruta = rutaOK
|
||||||
def ruta_docu = root+"Documentales/plain/"
|
def ruta_docu = root+"Documentales/plain/"
|
||||||
|
@ -10,7 +11,6 @@ def ruta_animacion = root+"Pelis_animacion/"
|
||||||
def ruta_infantil = root+"Pelis_infantiles/"
|
def ruta_infantil = root+"Pelis_infantiles/"
|
||||||
def ruta_familiar = root+"Pelis_familiar/"
|
def ruta_familiar = root+"Pelis_familiar/"
|
||||||
def ruta_esp = root+"Pelis_esp/plain/"
|
def ruta_esp = root+"Pelis_esp/plain/"
|
||||||
def ruta_semiesp = root+"Pelis_esp/posible_esp/"
|
|
||||||
def ruta_retro = root+"Pelis_retro/plain/"
|
def ruta_retro = root+"Pelis_retro/plain/"
|
||||||
def ruta_estrenos = root+"Pelis_estrenos/plain/"
|
def ruta_estrenos = root+"Pelis_estrenos/plain/"
|
||||||
def ruta_classic = root+"Pelis_classic/"
|
def ruta_classic = root+"Pelis_classic/"
|
||||||
|
@ -19,25 +19,8 @@ def ruta_asiaticas = root+"Pelis_asiaticas/"
|
||||||
def rutaKO = root+"error/"
|
def rutaKO = root+"error/"
|
||||||
/**********/
|
/**********/
|
||||||
|
|
||||||
/*TEST*/
|
|
||||||
/*def x = (certification =='PG.7' || certification =='G')
|
|
||||||
return certification + genres +x*/
|
|
||||||
//resultado = info.ProductionCountries
|
|
||||||
//return certification
|
|
||||||
//return genres+genres.contains('Animación')//+anime
|
|
||||||
//return genres.contains('Comedia')
|
|
||||||
//return genres.contains('Familia')
|
|
||||||
//return tieneGeneroFamilia(genres)
|
|
||||||
//return (genres[1]=~ /Animaci\p{L}n/).find()
|
|
||||||
//return tmdbid
|
|
||||||
//return localize.cat.n
|
|
||||||
//return primaryTitle+' cat: '+localize.cat.n+' esp:'+localize.Spanish.n
|
|
||||||
//return primaryTitle+' '+localize.Catalan.plex.name
|
|
||||||
/**/
|
|
||||||
|
|
||||||
/* HARDCODED */
|
/* HARDCODED */
|
||||||
def skipAudioCheck = true
|
def skipAudioCheck = true
|
||||||
def infantilHardCoded = false
|
|
||||||
/*************/
|
/*************/
|
||||||
|
|
||||||
/* Excepciones */
|
/* Excepciones */
|
||||||
|
@ -139,20 +122,26 @@ def esDocumental (generos, title) {
|
||||||
def noJackass = !(title =~ /Jackass/)
|
def noJackass = !(title =~ /Jackass/)
|
||||||
return (tieneGeneroDocumental(generos) || tieneGeneroReality(generos)) && noJackass
|
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 "))
|
||||||
nomIngles = nomIngles.replaceFirst("The ",'').replaceFirst("A ",'')
|
nomIngles = nomIngles.replaceFirst("The ",'').replaceFirst("A ",'')
|
||||||
def ini0 = nomIngles[0].toUpperCase()
|
def ini0 = nomIngles[0].toUpperCase()
|
||||||
def ini1 = nomIngles[1].toUpperCase()
|
def iniClear = nomIngles.size()>1 ? ini0.replaceAll(/[¡¿'#*\(]/,nomIngles[1].toUpperCase()) : ini0
|
||||||
def iniClear = ini0.replaceAll(/[¡¿'#*\(]/,ini1)
|
|
||||||
def inicial = iniClear.replaceAll(/[0-9]/,'#')+'/'
|
def inicial = iniClear.replaceAll(/[0-9]/,'#')+'/'
|
||||||
return inicial
|
return inicial
|
||||||
}
|
}
|
||||||
def fromEspPlatform (plataforma) {
|
|
||||||
return plataforma =~ /(?i)\bFLIXOL.\b|\bRTVE\b/
|
|
||||||
}
|
|
||||||
|
|
||||||
try { //empieza el script
|
try { //empieza el script
|
||||||
|
|
||||||
|
@ -408,86 +397,87 @@ try { //empieza el script
|
||||||
def generes
|
def generes
|
||||||
def errorNoGenero=false
|
def errorNoGenero=false
|
||||||
try {generes=genres} catch (err) {errorNoGenero=true}
|
try {generes=genres} catch (err) {errorNoGenero=true}
|
||||||
|
def numPaises = info.ProductionCountries.size()
|
||||||
|
|
||||||
def tieneAnimacion = tieneGeneroAnimacion(generes)
|
def tieneAnimacion = tieneGeneroAnimacion(generes)
|
||||||
def tieneFamiliar = tieneGeneroFamilia(generes)
|
def tieneFamiliar = tieneGeneroFamilia(generes)
|
||||||
|
|
||||||
def esDocu = esDocumental(generes, localize.English.n)
|
def esDocu = esDocumental(generes, localize.English.n)
|
||||||
def esAnime = anime || (tieneAnimacion && info.ProductionCountries.contains("JP"))
|
def esAnime = false
|
||||||
if (esAnime) {
|
if (tieneAnimacion && info.ProductionCountries.contains("JP")) {
|
||||||
def noAnimeListEx = [351460]
|
esAnime = numPaises==1 || anime
|
||||||
if (noAnimeListEx.contains(tmdbid)) esAnime=false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tieneAnimacion) {
|
//*** española ***
|
||||||
def noAnimacionListEx = [554377, 708962, 35114]
|
def hispanico = info.ProductionCountries.contains("ES") && (numPaises==1 || (numPaises==2 && info.ProductionCountries.contains("PT")))
|
||||||
if (noAnimacionListEx.contains(tmdbid)) tieneAnimacion=false
|
def espanyola = hispanico || fromEspPlatform() || (info.Certifications.size()==1 && info.Certifications.ES!=null)
|
||||||
}
|
//|| ({ try { languages.size()==1 && languages.get(0)=="esp" } catch (Exception e) { null } })()
|
||||||
|
|
||||||
//infantil
|
|
||||||
|
//***** familiar vs infantil ****
|
||||||
|
def esFamiliar = tieneFamiliar
|
||||||
def infantil = false
|
def infantil = false
|
||||||
|
|
||||||
|
def tipoYaSeteado=esDocu || esAnime
|
||||||
|
if (!tipoYaSeteado) {
|
||||||
|
|
||||||
|
def tieneCertificacion = info.Certifications!=null && info.Certifications.size()!=0
|
||||||
|
|
||||||
if (tieneFamiliar && tieneAnimacion) {
|
if (tieneFamiliar && tieneAnimacion) {
|
||||||
infantil=true
|
def noTanInfantil = info.Certifications.US ==~/PG-13/
|
||||||
} /*else {
|
if (!noTanInfantil)
|
||||||
def certificacio
|
|
||||||
try {certificacio=certification} catch (err) {
|
|
||||||
certificacio = info.certifications.ES
|
|
||||||
if (certificacio==null)
|
|
||||||
certificacio = info.certifications.DE
|
|
||||||
}
|
|
||||||
if (certificacio!=null) {
|
|
||||||
def familyCert = ['A', 'G', 'APTA', 'TP']
|
|
||||||
if (familyCert.contains(certificacio))
|
|
||||||
infantil = true
|
infantil = true
|
||||||
}
|
}
|
||||||
def certsMap = info.certifications
|
else if (tieneAnimacion) {
|
||||||
if (certsMap.size()>0) {
|
if (tieneCertificacion) {
|
||||||
def noNens=false
|
if ( info.Certifications.US=="G"
|
||||||
certsMap.each { key, val ->
|
|| info.Certifications.ES==~/Ai|APTA/
|
||||||
def num = val.findAll( /\d+/ )*.toInteger()
|
|| info.Certifications.DE==~/0|6/
|
||||||
if (num!=null && num[0]!=null) {
|
|| info.Certifications.IT=="T"
|
||||||
try{
|
|| info.Certifications.LT=="V" || info.Certifications.RU ==~ /6.+/
|
||||||
if (num[0]<8 && num[0]>1) {
|
|| info.Certifications.BR=="L"
|
||||||
|
)
|
||||||
|
infantil=true
|
||||||
|
} else {
|
||||||
|
def titulosInfantiles = ['Bonnie bears', 'The Jungle Bunch']
|
||||||
|
if (titulosInfantiles.any { localize.English.n.toLowerCase()contains(it.toLowerCase()) })
|
||||||
infantil = true
|
infantil = true
|
||||||
} else if (num[0]>8) {
|
|
||||||
noNens=true
|
|
||||||
}
|
}
|
||||||
}catch (err) {}
|
} else if (!esFamiliar) {
|
||||||
|
if (tieneCertificacion && (
|
||||||
|
info.Certifications.US=="G"
|
||||||
|
)) {
|
||||||
|
esFamiliar = true //posem a familiar pelis de nens que no son animacio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (infantil && noNens) infantil=false
|
|
||||||
}
|
}
|
||||||
}*/
|
|
||||||
|
|
||||||
//excepcions espanyoles
|
|
||||||
def semiEsp
|
|
||||||
def probablEsp = info.ProductionCountries.contains("ES")
|
|
||||||
def espanyola = fromEspPlatform(plataforma) || (probablEsp && info.ProductionCountries.size()==1)
|
|
||||||
if (probablEsp && info.ProductionCountries.size()>1) semiEsp = true
|
|
||||||
|
|
||||||
def espListEx = [401545, 584427, 589203, 655187, 441614, 517327, 516856, 351097, 267579, 573150, 437036, 56812, 11429, 127864, 510318, 209251, 443585, 33273, 8881, 351809, 499547, 351145, 684471]
|
|
||||||
def noEspListEx = [290859, 1562, 530915, 329718, 248842, 353979, 34186, 2395, 735129, 421792, 335984, 591789, 429, 26388, 18898, 266396, 85872, 352161, 43020, 339967, 446696, 38031]
|
|
||||||
if (noEspListEx.contains(tmdbid)) {
|
|
||||||
semiEsp=false
|
|
||||||
espanyola=false
|
|
||||||
} else if (espListEx.contains(tmdbid)) espanyola=true
|
|
||||||
//asiaticas
|
//asiaticas
|
||||||
def asiatica = false
|
def asiatica = false
|
||||||
if (info.ProductionCountries.size()>0) {
|
tipoYaSeteado = tipoYaSeteado & (infantil || espanyola)
|
||||||
|
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)
|
||||||
if (matchP.size()==info.ProductionCountries.size()) asiatica=true
|
def allAsian = matchP.size()==numPaises
|
||||||
|
def probableAsian = matchP.size()>0 && englishAudios.isEmpty() && audio.size()>1
|
||||||
|
if (allAsian || probableAsian/*en obseracion*/) asiatica=true
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//es animacion
|
||||||
|
def esAnimacion = tieneAnimacion && !esFamiliar && !espanyola && !asiatica
|
||||||
|
|
||||||
|
|
||||||
//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 (tieneFamiliar) 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 (semiEsp) ruta = ruta_semiesp
|
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
|
||||||
|
@ -501,7 +491,7 @@ try { //empieza el script
|
||||||
def inicial=''
|
def inicial=''
|
||||||
|
|
||||||
def inicialsRequerides = ruta==rutaOK || ruta==ruta_retro
|
def inicialsRequerides = ruta==rutaOK || ruta==ruta_retro
|
||||||
if (inicialsActivades && inicialsRequerides) {
|
if (inicialsRequerides) {
|
||||||
inicial = getInicial()
|
inicial = getInicial()
|
||||||
}
|
}
|
||||||
def tmdb = " {tmdb-"+tmdbid+"}"
|
def tmdb = " {tmdb-"+tmdbid+"}"
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
//by @xeviff
|
//by @xeviff
|
||||||
/** RUTAS **/
|
/** RUTAS **/
|
||||||
def inicialsActivades=true
|
def ubuntu_desktop=true
|
||||||
def root = '/pelis/'
|
|
||||||
|
def root = ubuntu_desktop ? '/mnt/mangrana_pelis/' : '/pelis/'
|
||||||
def rutaOK = root+"Pelis/plain/"
|
def rutaOK = root+"Pelis/plain/"
|
||||||
def ruta = rutaOK
|
def ruta = rutaOK
|
||||||
def ruta_docu = root+"Documentales/plain/"
|
def ruta_docu = root+"Documentales/plain/"
|
||||||
|
@ -10,7 +11,6 @@ def ruta_animacion = root+"Pelis_animacion/"
|
||||||
def ruta_infantil = root+"Pelis_infantiles/"
|
def ruta_infantil = root+"Pelis_infantiles/"
|
||||||
def ruta_familiar = root+"Pelis_familiar/"
|
def ruta_familiar = root+"Pelis_familiar/"
|
||||||
def ruta_esp = root+"Pelis_esp/plain/"
|
def ruta_esp = root+"Pelis_esp/plain/"
|
||||||
def ruta_semiesp = root+"Pelis_esp/posible_esp/"
|
|
||||||
def ruta_retro = root+"Pelis_retro/plain/"
|
def ruta_retro = root+"Pelis_retro/plain/"
|
||||||
def ruta_estrenos = root+"Pelis_estrenos/plain/"
|
def ruta_estrenos = root+"Pelis_estrenos/plain/"
|
||||||
def ruta_classic = root+"Pelis_classic/"
|
def ruta_classic = root+"Pelis_classic/"
|
||||||
|
@ -54,7 +54,7 @@ def tieneGeneroReality (generos) {
|
||||||
}
|
}
|
||||||
def esDocumental (generos, title) {
|
def esDocumental (generos, title) {
|
||||||
def noJackass = !(title =~ /Jackass/)
|
def noJackass = !(title =~ /Jackass/)
|
||||||
return tieneGeneroDocumental(generos) && noJackass
|
return (tieneGeneroDocumental(generos) || tieneGeneroReality(generos)) && noJackass
|
||||||
}
|
}
|
||||||
def fromEspPlatform () {
|
def fromEspPlatform () {
|
||||||
return fn.find(/(?i)\bFLIXOL.\b|\bRTVE\b/) != null
|
return fn.find(/(?i)\bFLIXOL.\b|\bRTVE\b/) != null
|
||||||
|
@ -65,14 +65,26 @@ def getInicial () {
|
||||||
if (nomIngles.startsWith("The ") || nomIngles.startsWith("A "))
|
if (nomIngles.startsWith("The ") || nomIngles.startsWith("A "))
|
||||||
nomIngles = nomIngles.replaceFirst("The ",'').replaceFirst("A ",'')
|
nomIngles = nomIngles.replaceFirst("The ",'').replaceFirst("A ",'')
|
||||||
def ini0 = nomIngles[0].toUpperCase()
|
def ini0 = nomIngles[0].toUpperCase()
|
||||||
def ini1 = nomIngles[1].toUpperCase()
|
def iniClear = nomIngles.size()>1 ? ini0.replaceAll(/[¡¿'#*\(]/,nomIngles[1].toUpperCase()) : ini0
|
||||||
def iniClear = ini0.replaceAll(/[¡¿'#*\(]/,ini1)
|
|
||||||
def inicial = iniClear.replaceAll(/[0-9]/,'#')+'/'
|
def inicial = iniClear.replaceAll(/[0-9]/,'#')+'/'
|
||||||
return inicial
|
return inicial
|
||||||
}
|
}
|
||||||
|
def sanityCheck() {
|
||||||
|
def clearCurrentName = fn.replaceAll(/\s|-|:|∶|\./,'')
|
||||||
|
def clearPlexName = plex.name.replaceAll(/\s|-|:|∶|\./,'')
|
||||||
|
if (clearCurrentName.substring(0, clearCurrentName.size()-6)!=clearPlexName.substring(0, clearPlexName.size()-6))
|
||||||
|
return false
|
||||||
|
def yearOldName = clearCurrentName.substring(clearCurrentName.size()-5, clearCurrentName.size()-1) as int
|
||||||
|
def yearNewName = clearPlexName.substring(clearPlexName.size()-5, clearPlexName.size()-1) as int
|
||||||
|
return Math.abs(yearOldName - yearNewName) < 2
|
||||||
|
}
|
||||||
|
//*****************************************************************************************/
|
||||||
|
//*****************************************************************************************/
|
||||||
|
//*****************************************************************************************/
|
||||||
try { //empieza el script
|
try { //empieza el script
|
||||||
|
|
||||||
|
//sanity check
|
||||||
|
if (!sanityCheck()) return '@@@@@@ Names Sanity Check KO @@@@@@@ --> New name: '+plex.name
|
||||||
|
|
||||||
try {
|
try {
|
||||||
video
|
video
|
||||||
|
@ -93,7 +105,7 @@ try { //empieza el script
|
||||||
def idioma
|
def idioma
|
||||||
try {
|
try {
|
||||||
idioma = item.Language_String
|
idioma = item.Language_String
|
||||||
if (idioma==null) throw new Exception("[idioma_audio_no_definido0]")
|
if (idioma==null) otherAudios.add("audio_no_def")
|
||||||
if ("Catalan"==idioma) catalanAudios.add(item)
|
if ("Catalan"==idioma) catalanAudios.add(item)
|
||||||
else if (idioma=~/(?i)(Spanish|Espa.ol)/) spanishAudios.add(item)
|
else if (idioma=~/(?i)(Spanish|Espa.ol)/) spanishAudios.add(item)
|
||||||
else if ("English"==idioma) englishAudios.add(item)
|
else if ("English"==idioma) englishAudios.add(item)
|
||||||
|
@ -127,11 +139,11 @@ try { //empieza el script
|
||||||
} else if (!spanishAudios.isEmpty()) { //tenemos español
|
} else if (!spanishAudios.isEmpty()) { //tenemos español
|
||||||
|
|
||||||
} else if (!englishAudios.isEmpty()) {
|
} else if (!englishAudios.isEmpty()) {
|
||||||
throw new Exception("[idioma_audio_solo_ingles]")
|
if (!skipAudioCheck) throw new Exception("[idioma_audio_solo_ingles]")
|
||||||
} else if (!otherAudios.isEmpty()) {
|
} else if (!otherAudios.isEmpty()) {
|
||||||
throw new Exception("[idioma_audio_marginal]")
|
if (!skipAudioCheck) throw new Exception("[idioma_audio_marginal]")
|
||||||
} else {
|
} else {
|
||||||
throw new Exception("[idioma_audio_no_encontrado]")
|
if (!skipAudioCheck) throw new Exception("[idioma_audio_no_encontrado]")
|
||||||
}
|
}
|
||||||
/***********/
|
/***********/
|
||||||
|
|
||||||
|
@ -146,63 +158,90 @@ try { //empieza el script
|
||||||
def tieneFamiliar = tieneGeneroFamilia(generes)
|
def tieneFamiliar = tieneGeneroFamilia(generes)
|
||||||
|
|
||||||
def esDocu = esDocumental(generes, localize.English.n)
|
def esDocu = esDocumental(generes, localize.English.n)
|
||||||
def esAnime = anime || (tieneAnimacion && info.ProductionCountries.contains("JP"))
|
def esAnime = false
|
||||||
if (esAnime) {
|
if (tieneAnimacion && info.ProductionCountries.contains("JP")) {
|
||||||
def noAnimeListEx = [351460]
|
esAnime = info.ProductionCountries.size()==1 || anime
|
||||||
if (noAnimeListEx.contains(tmdbid)) esAnime=false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tieneAnimacion) {
|
//***** familiar vs infantil ****
|
||||||
def noAnimacionListEx = [554377, 708962, 35114]
|
def esFamiliar = tieneFamiliar
|
||||||
if (noAnimacionListEx.contains(tmdbid)) tieneAnimacion=false
|
def infantil = false
|
||||||
|
|
||||||
|
def tipoYaSeteado=esDocu || esAnime
|
||||||
|
if (!tipoYaSeteado) {
|
||||||
|
|
||||||
|
def tieneCertificacion = info.Certifications!=null && info.Certifications.size()!=0
|
||||||
|
|
||||||
|
if (tieneFamiliar && tieneAnimacion) {
|
||||||
|
def noTanInfantil = info.Certifications.US ==~/PG-13/
|
||||||
|
if (!noTanInfantil)
|
||||||
|
infantil = true
|
||||||
|
}
|
||||||
|
else if (tieneAnimacion) {
|
||||||
|
if (tieneCertificacion) {
|
||||||
|
if ( info.Certifications.US=="G"
|
||||||
|
|| info.Certifications.ES==~/Ai|APTA/
|
||||||
|
|| info.Certifications.DE==~/0|6/
|
||||||
|
|| info.Certifications.IT=="T"
|
||||||
|
|| info.Certifications.LT=="V" || info.Certifications.RU ==~ /6.+/
|
||||||
|
|| info.Certifications.BR=="L"
|
||||||
|
)
|
||||||
|
infantil=true
|
||||||
|
} else {
|
||||||
|
def titulosInfantiles = ['Bonnie bears', 'The Jungle Bunch']
|
||||||
|
if (titulosInfantiles.any { localize.English.n.toLowerCase()contains(it.toLowerCase()) })
|
||||||
|
infantil = true
|
||||||
|
}
|
||||||
|
} else if (!esFamiliar) {
|
||||||
|
if (tieneCertificacion && (
|
||||||
|
info.Certifications.US=="G"
|
||||||
|
)) {
|
||||||
|
esFamiliar = true //posem a familiar pelis de nens que no son animacio
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//infantil
|
//espanyoles & asiaticas
|
||||||
def infantil= tieneFamiliar && tieneAnimacion
|
def espanyola = false
|
||||||
|
|
||||||
//excepcions espanyoles
|
|
||||||
def semiEsp
|
|
||||||
def probablEsp = info.ProductionCountries.contains("ES")
|
|
||||||
def espanyola = fromEspPlatform() || (probablEsp && info.ProductionCountries.size()==1)
|
|
||||||
if (probablEsp && info.ProductionCountries.size()>1) semiEsp = true
|
|
||||||
|
|
||||||
def espListEx = [401545, 584427, 589203, 655187, 441614, 517327, 516856, 351097, 267579, 573150, 437036, 56812, 11429, 127864, 510318, 209251, 443585, 33273, 8881, 351809, 499547, 351145, 684471]
|
|
||||||
def noEspListEx = [290859, 1562, 530915, 329718, 248842, 353979, 34186, 2395, 735129, 421792, 335984, 591789, 429, 26388, 18898, 266396, 85872, 352161, 43020, 339967, 446696, 38031]
|
|
||||||
if (noEspListEx.contains(tmdbid)) {
|
|
||||||
semiEsp=false
|
|
||||||
espanyola=false
|
|
||||||
} else if (espListEx.contains(tmdbid)) espanyola=true
|
|
||||||
//asiaticas
|
|
||||||
def asiatica = false
|
def asiatica = false
|
||||||
if (info.ProductionCountries.size()>0) {
|
tipoYaSeteado=esDocu || esAnime || esFamiliar || infantil
|
||||||
|
if (!tipoYaSeteado) {
|
||||||
|
|
||||||
|
def segurEsp = info.ProductionCountries.contains("ES") && info.ProductionCountries.size()==1
|
||||||
|
espanyola = fromEspPlatform() || segurEsp
|
||||||
|
|
||||||
|
//asiaticas
|
||||||
|
if (!espanyola && info.ProductionCountries.size()>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)
|
||||||
if (matchP.size()==info.ProductionCountries.size()) asiatica=true
|
def allAsian = matchP.size()==info.ProductionCountries.size()
|
||||||
|
def probableAsian = matchP.size()>0 && englishAudios.isEmpty() && audio.size()>1
|
||||||
|
if (allAsian || probableAsian/*en obseracion*/) asiatica=true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//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 (tieneFamiliar) ruta = ruta_familiar
|
else if (esFamiliar) ruta = ruta_familiar
|
||||||
else if (tieneAnimacion) ruta = ruta_animacion
|
else if (tieneAnimacion) ruta = ruta_animacion
|
||||||
else if (asiatica) ruta = ruta_asiaticas
|
else if (asiatica) ruta = ruta_asiaticas
|
||||||
else if (espanyola) ruta = ruta_esp
|
else if (espanyola) ruta = ruta_esp
|
||||||
else if (semiEsp) ruta = ruta_semiesp
|
|
||||||
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 )
|
//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]")
|
// throw new Exception("[genero_no_especificado]")
|
||||||
|
|
||||||
/*** RESULTADO FINAL ***/
|
/*** RESULTADO FINAL ***/
|
||||||
def inicial=''
|
def inicial=''
|
||||||
|
|
||||||
def inicialsRequerides = ruta==rutaOK || ruta==ruta_retro
|
def inicialsRequerides = ruta==rutaOK || ruta==ruta_retro
|
||||||
if (inicialsActivades && inicialsRequerides) {
|
if (inicialsRequerides) {
|
||||||
inicial = getInicial()
|
inicial = getInicial()
|
||||||
}
|
}
|
||||||
def tracker = fn.find(/(?i)\bHDO(limpo)?\b/)
|
def tracker = fn.find(/(?i)\bHDO(limpo)?\b/)
|
||||||
|
|
|
@ -51,6 +51,9 @@ def tieneGeneroReality (generos) {
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
def normalitzarText(txt) {
|
||||||
|
return txt.replaceAll(':','.').replaceAll('\\?','¿').replaceAll('\\"','-')
|
||||||
|
}
|
||||||
/**/
|
/**/
|
||||||
|
|
||||||
|
|
||||||
|
@ -77,8 +80,9 @@ try { //empieza el script
|
||||||
def esReality = tieneGeneroReality(generes)
|
def esReality = tieneGeneroReality(generes)
|
||||||
//esp?
|
//esp?
|
||||||
def esEsp=false
|
def esEsp=false
|
||||||
def spanishNetwork = info.Network.find(/(?i)\bTVE\b|\bmovistar\b|\bAtresmedia\b|\bcanal 9\b|\bPlayz\b|\bATRES\b|\bETB1\b|\bTV3\b|\btelecinco\b|\bcanal+\b|\bgalicia\b|\bfox españa\b|\blasexta\b|\bantena 3\b/ )
|
def spanishNetwork
|
||||||
if (spanishNetwork!=null) esEsp=true
|
try{ spanishNetwork = info.Network.find(/(?i)\bTVE\b|\bmovistar\b|\bAtresmedia\b|\bcanal 9\b|\bPlayz\b|\bATRES\b|\bETB1\b|\bTV3\b|\btelecinco\b|\bcanal+\b|\bgalicia\b|\bfox españa\b|\blasexta\b|\bantena 3\b/ )} catch(e){}
|
||||||
|
if (spanishNetwork!=null || Country=='esp') esEsp=true
|
||||||
//tria
|
//tria
|
||||||
/*if (tenimCat) ruta = ruta_cat
|
/*if (tenimCat) ruta = ruta_cat
|
||||||
else */if (esDocu) ruta = ruta_docu
|
else */if (esDocu) ruta = ruta_docu
|
||||||
|
@ -94,8 +98,8 @@ try { //empieza el script
|
||||||
|
|
||||||
/****************************/
|
/****************************/
|
||||||
/**** Nombre de fichero *******/
|
/**** Nombre de fichero *******/
|
||||||
|
def cuaTvdb = " {tvdb-"+id+"}"
|
||||||
def nombreSerie = '/' + localize.English.ny + '/'
|
def nombreSerie = '/' + normalitzarText(localize.English.ny) + cuaTvdb + '/'
|
||||||
def temporada = episode.special ?
|
def temporada = episode.special ?
|
||||||
'Specials'+'/' :
|
'Specials'+'/' :
|
||||||
'Temporada '+ s.pad(2) + '/'
|
'Temporada '+ s.pad(2) + '/'
|
||||||
|
@ -109,11 +113,11 @@ try { //empieza el script
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
||||||
|
/*
|
||||||
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]
|
return " Error at line number = " + pattern[0][1]
|
||||||
|
*/
|
||||||
|
|
||||||
def rutaMotivoErr
|
def rutaMotivoErr
|
||||||
def msgErr = err.getMessage()
|
def msgErr = err.getMessage()
|
||||||
|
|
Loading…
Reference in New Issue