1
0
Fork 0

delete cat and insert infantil, fix organizer

This commit is contained in:
xeviff 2023-05-02 11:45:30 +02:00
parent 5402145ae9
commit a0f2540003
2 changed files with 92 additions and 112 deletions

View File

@ -8,7 +8,7 @@ def ruta_docu = root+"Documentales/plain/"
def ruta_anime = root+"Pelis_anime/plain/"
def ruta_animacion = root+"Pelis_animacion/"
def ruta_infantil = root+"Pelis_infantiles/"
def ruta_cat = root+"Pelis_amb_cat/"
def ruta_familiar = root+"Pelis_familiar/"
def ruta_esp = root+"Pelis_esp/plain/"
def ruta_semiesp = root+"Pelis_esp/posible_esp/"
def ruta_retro = root+"Pelis_retro/plain/"
@ -128,9 +128,16 @@ def tieneGeneroDocumental (generos) {
}
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) && noJackass
return (tieneGeneroDocumental(generos) || tieneGeneroReality(generos)) && noJackass
}
/**/
def getInicial () {
@ -144,7 +151,7 @@ def getInicial () {
return inicial
}
def fromEspPlatform (plataforma) {
return plataforma =~ /(?i)\bFLIXOLE\b|\bRTVE\b/
return plataforma =~ /(?i)\bFLIXOL.\b|\bRTVE\b/
}
try { //empieza el script
@ -285,7 +292,7 @@ try { //empieza el script
if (esWEB_DL) {
def web_x = fn=~/(?i)\bWEB.?DL\b/ ? 'WEB-DL' : 'WEB-RIP' //guardar el que es
plataforma = fn.find( //coge el contenido que encaja
/(?i)\bSATRIP\b|\bDVB\b|\bFLXL\b|\bAMZN?\b|\bNF\b|\bHBO\b|\bHBO.?MAX\b|\bHMAX\b|\bHULU\b|\bA3P\b|\bDPLY\b|\bSTARZ\b|\bFILMIN\b|\bFLMN\b|\bNETFLIX\b|\bDSN.?\b|\bDSP+?\b|\bRTVE\b|\bFLIXOLE\b/ )
/(?i)\bAMZN?\b|\bNF\b|\bHBO\b|\bHBO.?MAX\b|\bHMAX\b|\bHULU\b|\bA3P\b|\bDPLY\b|\bSTARZ\b|\bFILMIN\b|\bFLMN\b|\bNETFLIX\b|\bDSN.?\b|\bDSP+?\b|\bRTVE\b|\bFLIXOL.\b|\bM\+\b/ )
if (plataforma!=null) plataforma = plataforma.replace("MVPLUS","MV+")
formato_distribucion = web_x+(plataforma!=null?(' '+plataforma.toUpperCase()):'') //web-dl/rip + plataforma(si hay)
} else {
@ -402,59 +409,56 @@ try { //empieza el script
def errorNoGenero=false
try {generes=genres} catch (err) {errorNoGenero=true}
def tieneAnimacion = tieneGeneroAnimacion(generes)
def tieneFamiliar = tieneGeneroFamilia(generes)
def esDocu = esDocumental(generes, localize.English.n)
def esAnime = anime || (tieneGeneroAnimacion(generes) && info.ProductionCountries.contains("JP"))
def esAnime = anime || (tieneAnimacion && info.ProductionCountries.contains("JP"))
if (esAnime) {
def noAnimeListEx = [351460]
if (noAnimeListEx.contains(tmdbid)) esAnime=false
}
def esAnimacion = tieneGeneroAnimacion(generes)
if (esAnimacion) {
if (tieneAnimacion) {
def noAnimacionListEx = [554377, 708962, 35114]
if (noAnimacionListEx.contains(tmdbid)) esAnimacion=false
if (noAnimacionListEx.contains(tmdbid)) tieneAnimacion=false
}
//infantil
def infantil=false
def famyListEx = [575100]
def noFamyListEx = [10637, 6639, 336121, 248688]
if (famyListEx.contains(tmdbid)) infantil=true
else if (noFamyListEx.contains(tmdbid)) infantil=false
else {
if (tieneGeneroFamilia(generes)) {
infantil=true
if (y<1980 && !esAnimacion) infantil=false
} else {
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
}
def certsMap = info.certifications
if (certsMap.size()>0) {
def noNens=false
certsMap.each { key, val ->
def num = val.findAll( /\d+/ )*.toInteger()
if (num!=null && num[0]!=null) {
try{
if (num[0]<8 && num[0]>1) {
infantil=true
} else if (num[0]>8) {
noNens=true
}
}catch (err) {}
}
}
if (infantil && noNens) infantil=false
}
if (tieneFamiliar && tieneAnimacion) {
infantil=true
} /*else {
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
}
def certsMap = info.certifications
if (certsMap.size()>0) {
def noNens=false
certsMap.each { key, val ->
def num = val.findAll( /\d+/ )*.toInteger()
if (num!=null && num[0]!=null) {
try{
if (num[0]<8 && num[0]>1) {
infantil=true
} else if (num[0]>8) {
noNens=true
}
}catch (err) {}
}
}
if (infantil && noNens) infantil=false
}
}*/
//excepcions espanyoles
def semiEsp
def probablEsp = info.ProductionCountries.contains("ES")
@ -476,11 +480,11 @@ try { //empieza el script
}
//tria
if (tenimCat) ruta = ruta_cat
else if (esDocu) ruta = ruta_docu
if (esDocu) ruta = ruta_docu
else if (esAnime) ruta = ruta_anime
else if (infantil) ruta = ruta_infantil
else if (esAnimacion) ruta = ruta_animacion
else if (tieneFamiliar) ruta = ruta_familiar
else if (tieneAnimacion) ruta = ruta_animacion
else if (asiatica) ruta = ruta_asiaticas
else if (espanyola) ruta = ruta_esp
else if (semiEsp) ruta = ruta_semiesp
@ -490,13 +494,13 @@ try { //empieza el script
/********************************************/
/**************************************/
//if (errorNoGenero && !tenimCat && ruta!=ruta_classic && ruta!=ruta_retro && !espanyola && !semiEsp && !infantil && ruta!=ruta_estrenos )
//if (errorNoGenero && ruta!=ruta_classic && ruta!=ruta_retro && !espanyola && !semiEsp && !infantil && ruta!=ruta_estrenos )
// throw new Exception("[genero_no_especificado]")
/*** RESULTADO FINAL ***/
def inicial=''
def inicialsRequerides = ruta==rutaOK || ruta==ruta_retro || ruta==ruta_infantil
def inicialsRequerides = ruta==rutaOK || ruta==ruta_retro
if (inicialsActivades && inicialsRequerides) {
inicial = getInicial()
}

View File

@ -8,6 +8,7 @@ def ruta_docu = root+"Documentales/plain/"
def ruta_anime = root+"Pelis_anime/plain/"
def ruta_animacion = root+"Pelis_animacion/"
def ruta_infantil = root+"Pelis_infantiles/"
def ruta_familiar = root+"Pelis_familiar/"
def ruta_esp = root+"Pelis_esp/plain/"
def ruta_semiesp = root+"Pelis_esp/posible_esp/"
def ruta_retro = root+"Pelis_retro/plain/"
@ -18,7 +19,9 @@ def ruta_asiaticas = root+"Pelis_asiaticas/"
def rutaKO = root+"error/"
/**********/
/* HARDCODED */
def skipAudioCheck = true
def infantilHardCoded = false
/* otras funciones */
def tieneGeneroAnimacion (generos) {
@ -42,10 +45,20 @@ def tieneGeneroDocumental (generos) {
}
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) && noJackass
}
def fromEspPlatform () {
return fn.find(/(?i)\bFLIXOL.\b|\bRTVE\b/) != null
}
/**/
def getInicial () {
def nomIngles = localize.English.n
@ -60,9 +73,7 @@ def getInicial () {
try { //empieza el script
if (ext!="mkv" && ext!="avi" && ext!="mp4") {
throw new Exception("[formato_fichero_noestarndar]")
}
try {
video
} catch (e) {
@ -102,12 +113,12 @@ try { //empieza el script
else otherAudios.add(item)
}
} catch (ex) {}
} else throw err
} else if (!skipAudioCheck) throw err
}
}
if (audioDeclUndefined || (catalanAudios.isEmpty() && spanishAudios.isEmpty() && englishAudios.isEmpty() && otherAudios.isEmpty()) ) {
throw new Exception("[idioma_audio_no_definido]")
if (!skipAudioCheck) throw new Exception("[idioma_audio_no_definido]")
}
def tenimCat=false
if (!catalanAudios.isEmpty()) { //tenim català
@ -131,64 +142,28 @@ try { //empieza el script
def errorNoGenero=false
try {generes=genres} catch (err) {errorNoGenero=true}
def tieneAnimacion = tieneGeneroAnimacion(generes)
def tieneFamiliar = tieneGeneroFamilia(generes)
def esDocu = esDocumental(generes, localize.English.n)
def esAnime = anime || (tieneGeneroAnimacion(generes) && info.ProductionCountries.contains("JP"))
def esAnime = anime || (tieneAnimacion && info.ProductionCountries.contains("JP"))
if (esAnime) {
def noAnimeListEx = [351460]
if (noAnimeListEx.contains(tmdbid)) esAnime=false
}
def esAnimacion = tieneGeneroAnimacion(generes)
if (esAnimacion) {
if (tieneAnimacion) {
def noAnimacionListEx = [554377, 708962, 35114]
if (noAnimacionListEx.contains(tmdbid)) esAnimacion=false
if (noAnimacionListEx.contains(tmdbid)) tieneAnimacion=false
}
//infantil
def infantil=false
def famyListEx = [575100]
def noFamyListEx = [10637, 6639, 336121, 248688]
if (famyListEx.contains(tmdbid)) infantil=true
else if (noFamyListEx.contains(tmdbid)) infantil=false
else {
if (tieneGeneroFamilia(generes)) {
infantil=true
if (y<1980 && !esAnimacion) infantil=false
} else {
def certificacio
try {certificacio=certification} catch (err) {
certificacio = info.certifications.ES
if (certificacio==null)
certificacio = info.certifications.DE
}
if (certificacio!=null) {
def familyCert = ['A', 'PG.7', 'G', 'APTA', 'TP']
if (familyCert.contains(certificacio))
infantil=true
}
def certsMap = info.certifications
if (certsMap.size()>0) {
def noNens=false
certsMap.each { key, val ->
def num = val.findAll( /\d+/ )*.toInteger()
if (num!=null && num[0]!=null) {
try{
if (num[0]<8 && num[0]>1) {
infantil=true
} else if (num[0]>8) {
noNens=true
}
}catch (err) {}
}
}
if (infantil && noNens) infantil=false
}
}
}
def infantil= tieneFamiliar && tieneAnimacion
//excepcions espanyoles
def semiEsp
def probablEsp = info.ProductionCountries.contains("ES")
if (probablEsp && info.ProductionCountries.contains("US")) probablEsp=false
def espanyola = probablEsp && info.ProductionCountries.size()==1
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]
@ -200,32 +175,33 @@ try { //empieza el script
//asiaticas
def asiatica = false
if (info.ProductionCountries.size()>0) {
def paisesAsiaticos = ["CN", "HK", "JP", "KP", "KR", "TH", "NP", "TW", "PH"]
def paisesAsiaticos = ["CN", "HK", "JP", "KP", "KR", "TH", "NP", "TW", "PH", "MO"]
def matchP = paisesAsiaticos.intersect(info.ProductionCountries)
if (matchP.size()==info.ProductionCountries.size()) asiatica=true
}
//tria
if (esDocu) ruta = ruta_docu
else if (espanyola) ruta = ruta_esp
else if (semiEsp) ruta = ruta_semiesp
else if (esAnime) ruta = ruta_anime
else if (infantil) ruta = ruta_infantil
else if (esAnimacion) ruta = ruta_animacion
else if (tieneFamiliar) ruta = ruta_familiar
else if (tieneAnimacion) ruta = ruta_animacion
else if (asiatica) ruta = ruta_asiaticas
else if (espanyola) ruta = ruta_esp
else if (semiEsp) ruta = ruta_semiesp
else if (y<1980) ruta = ruta_classic
else if (y<2000) ruta = ruta_retro
if (ruta==rutaOK && y>=2021) ruta = ruta_estrenos
/********************************************/
/**************************************/
if (errorNoGenero && !tenimCat && 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]")
/*** RESULTADO FINAL ***/
def inicial=''
def inicialsRequerides = ruta==rutaOK || ruta==ruta_retro || ruta==ruta_infantil
def inicialsRequerides = ruta==rutaOK || ruta==ruta_retro
if (inicialsActivades && inicialsRequerides) {
inicial = getInicial()
}
@ -234,16 +210,16 @@ try { //empieza el script
def resultado = ruta + //directorios
//nombre fichero
inicial +
localize.English.plex.name + '/' + fn
localize.English.plex.name
return resultado
} catch (err) {
/*
String str= err.getStackTrace().toString()
def pattern = ( str =~ /groovy.(\d+)./ )
return " Error at line number = " + pattern[0][1] + ". more: "+str
*/
def rutaMotivoErr
def msgErr = err.getMessage()
if (msgErr=="[formato_fichero_noestarndar]" || msgErr=="[video_roto]")