diff --git a/MaNGranA_Pelis.groovy b/MaNGranA_Pelis.groovy index b0f2f41..5216071 100755 --- a/MaNGranA_Pelis.groovy +++ b/MaNGranA_Pelis.groovy @@ -15,6 +15,7 @@ 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_cat = root+"Pelis_cat/" def ruta_retro = root+"Pelis_retro/plain/" def ruta_estrenos = root+"Pelis_estrenos/plain/" def ruta_classic = root+"Pelis_classic/" @@ -214,6 +215,7 @@ try { //empieza el script //*** espaƱola *** def espanyola = false + def catalana = false if (!tipoYaSeteado && info.ProductionCountries.contains("ES")) { espanyola= (numPaises==1 || (numPaises==2 && info.ProductionCountries.any{ it=~/AR|PT/ })) @@ -223,9 +225,10 @@ try { //empieza el script || { llengu=normalLang(llengu); llengu.size()==1 && llengu[0]=~/esp|spa/}() || (movie.alternativeTitles.size()==1 && movie.alternativeTitles.ES!=null) || (country=="ES" && (!llengu.isEmpty() ? llengu.size()==1 && llengu[0]!="eng" : true)) + if (espanyola) catalana = { llengu=normalLang(llengu); llengu.contains('cat') }() tipoYaSeteado = espanyola } - + //***** familiar vs infantil **** def esFamiliar = tieneFamiliar def infantil = false @@ -285,6 +288,7 @@ try { //empieza el script else if (esAnime) ruta = ruta_anime else if (infantil) ruta = ruta_infantil else if (esAnimacion) ruta = ruta_animacion + else if (catalana) ruta = ruta_cat else if (espanyola) ruta = ruta_esp else if (esFamiliar) ruta = ruta_familiar else if (asiatica) ruta = ruta_asiaticas @@ -293,11 +297,8 @@ try { //empieza el script if (ruta==rutaOK && y>=2021) ruta = ruta_estrenos /********************************************/ - /**** 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 ***/ + def nombrePelicula_formatoPlex = {try { catalana ? localize.Catalan.n : localize.Spanish.plex.name } catch (err) {localize.Spanish.plex.name} }() def inicial = (ruta==rutaOK || ruta==ruta_retro) ? getInicial() : '' def tmdb = "{tmdb-"+tmdbid+"}" def carpetaPeli = localize.Spanish.plex.name + tmdb + '/' @@ -428,7 +429,7 @@ def getInicial () { return inicial } def normalLang(langs) { - return !langs.isEmpty() ? {try { for (lan in languages) langs.add(lan.toString()) } catch(err) {langs}}() : langs + return langs.isEmpty() ? {try { for (lan in languages) langs.add(lan.toString()); return langs } catch(err) {langs}}() : langs } def sanityCheck(newId) { def oldId = fn.find(/\{tmdb-\d+\}/)?.find(/\d+/)