From 42abd43078faafc8ab36dda004d26c3d2824bfec Mon Sep 17 00:00:00 2001 From: Kingbox <37674310+lopezvg@users.noreply.github.com> Date: Sat, 7 Jul 2018 14:15:18 +0200 Subject: [PATCH] =?UTF-8?q?Correcci=C3=B3n=20errores=20de=20traducci=C3=B3?= =?UTF-8?q?n=20y=20mejoras=20internas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Corregido error al marcar como vista/no vista una serie o película en la Videoteca de Alfa - Añadido soporte de etiquetas de idioma tipo @xxxxx, en campo ‘enabled’ en menus de confoguración - Reparación de Videlibrary.json quitando ']' en campos ‘enabled’ Newpct1: arreglo de error en series antiguas Generictools: mejora de etiquetado de títulos --- plugin.video.alfa/channels/newpct1.py | 11 +++++++++-- plugin.video.alfa/channels/videolibrary.json | 8 ++++---- plugin.video.alfa/lib/generictools.py | 9 +++++++-- plugin.video.alfa/platformcode/xbmc_config_menu.py | 5 ++++- plugin.video.alfa/platformcode/xbmc_videolibrary.py | 12 ++++++++---- 5 files changed, 32 insertions(+), 13 deletions(-) diff --git a/plugin.video.alfa/channels/newpct1.py b/plugin.video.alfa/channels/newpct1.py index 7a726cb1..f0d577f7 100644 --- a/plugin.video.alfa/channels/newpct1.py +++ b/plugin.video.alfa/channels/newpct1.py @@ -1386,8 +1386,12 @@ def episodios(item): pattern = ".*?[^>]+>.*?Temporada\s*(?P\d+)?.*?Capitulo(?:s)?\s*(?P\d+)?" \ "(?:.*?(?P\d+)?)<.+?]+>(?P.*?)?<\/span>\s*Calidad\s*]+>" \ "[\[]\s*(?P.*?)?\s*[\]]<\/span>" - if "Especial" in info: # Capitulos Especiales - pattern = ".*?[^>]+>.*?Temporada.*?\[.*?(?P\d+).*?\].*?Capitulo.*?\[\s*(?P\d+).*?\]?(?:.*?(?P\d+)?)<.+?]+>(?P.*?)?<\/span>\s*Calidad\s*]+>[\[]\s*(?P.*?)?\s*[\]]<\/span>" + if not scrapertools.find_single_match(info, pattern): + if "especial" in info.lower(): # Capitulos Especiales + pattern = ".*?[^>]+>.*?Temporada.*?\[.*?(?P\d+).*?\].*?Capitulo.*?\[\s*(?P\d+).*?\]?(?:.*?(?P\d+)?)<.+?]+>(?P.*?)?<\/span>\s*Calidad\s*]+>[\[]\s*(?P.*?)?\s*[\]]<\/span>" + elif "miniserie" in info.lower() or "completa" in info.lower(): # Series o miniseries completa + logger.debug("patron episodioNEW - MINISERIE: " + info) + info = '>%sTemporada %s Capitulo 01_99 - Español Castellano Calidad [%s]' % (item_local.contentSerieName, season, item_local.quality) if not scrapertools.find_single_match(info, pattern): #en caso de error de formato, creo uno básico logger.debug("patron episodioNEW: " + pattern) @@ -1413,6 +1417,9 @@ def episodios(item): elif "completa" in info.lower(): info = info.replace("COMPLETA", "Caps. 01_99") pattern = 'Temp.*?(?P\d+).*?Cap\w?\.\s\d?(?P\d{2})(?:.*?(?P\d{2}))?.*?\[(?P.*?)\].*?\[(?P\w+)\]?' + if not scrapertools.find_single_match(info, pattern): #en caso de error de formato, creo uno básico + logger.debug(info) + info = '%s - Temp.%s [Caps. 01_99][%s][Spanish]' % (item_local.contentSerieName, season, item_local.quality) if scrapertools.find_single_match(info, '\[Cap.\d{2,3}'): pattern = "\[(?P.*?)\].*?\[Cap.(?P\d).*?(?P\d{2})(?:_(?P\d+)" \ "(?P\d{2}))?.*?\].*?(?:\[(?P.*?)\])?" diff --git a/plugin.video.alfa/channels/videolibrary.json b/plugin.video.alfa/channels/videolibrary.json index 49121664..a68b173f 100755 --- a/plugin.video.alfa/channels/videolibrary.json +++ b/plugin.video.alfa/channels/videolibrary.json @@ -24,7 +24,7 @@ "label": "@60606", "default": 0, "visible": true, - "enabled": "eq(-1,@60603])|eq(-1,@60605])", + "enabled": "eq(-1,@60603)|eq(-1,@60605)", "lvalues": [ "No", "@60609", @@ -39,7 +39,7 @@ "label": "@60613", "default": 1, "visible": true, - "enabled": "eq(-2,@60604])|eq(-2,@60605])", + "enabled": "eq(-2,@60604)|eq(-2,@60605)", "lvalues": [ "00:00", "04:00", @@ -53,7 +53,7 @@ "label": "@60614", "default": 0, "visible": true, - "enabled": "!eq(-3,@60615])", + "enabled": "!eq(-3,@60615)", "lvalues": [ "@60616", "@60617" @@ -64,7 +64,7 @@ "type": "list", "label": "@60618", "default": 0, - "enabled": "!eq(-4,@60615])", + "enabled": "!eq(-4,@60615)", "lvalues": [ "@60619", "@60620" diff --git a/plugin.video.alfa/lib/generictools.py b/plugin.video.alfa/lib/generictools.py index dabb44d3..52962719 100644 --- a/plugin.video.alfa/lib/generictools.py +++ b/plugin.video.alfa/lib/generictools.py @@ -647,7 +647,12 @@ def post_tmdb_findvideos(item, itemlist): title = '%sx%s' % (str(item.contentSeason), str(item.contentEpisodeNumber).zfill(2)) #Temporada y Episodio if item.infoLabels['temporada_num_episodios']: title = '%s (de %s)' % (title, str(item.infoLabels['temporada_num_episodios'])) #Total Episodios - title = '%s %s' % (title, item.infoLabels['episodio_titulo']) #Título Episodio + + #Si son episodios múltiples, y viene de Videoteca, ponemos nombre de serie + if " al " in item.title and not " al " in item.infoLabels['episodio_titulo']: + title = '%s al %s - ' % (title, scrapertools.find_single_match(item.title, 'al (\d+)')) + else: + title = '%s %s' % (title, item.infoLabels['episodio_titulo']) #Título Episodio title_gen = '%s, %s [COLOR yellow][%s][/COLOR] [%s] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR] [%s]' % (title, item.contentSerieName, item.infoLabels['year'], rating, item.quality, str(item.language), scrapertools.find_single_match(item.title, '\s\[(\d+,?\d*?\s\w[b|B])\]')) #Rating, Calidad, Idioma, Tamaño if item.infoLabels['status'] and item.infoLabels['status'].lower() == "ended": title_gen = '[TERM.] %s' % title_gen #Marca cuando la Serie está terminada y no va a haber más producción @@ -668,7 +673,7 @@ def post_tmdb_findvideos(item, itemlist): if item.channel_alt: title_gen = '[COLOR yellow]%s [/COLOR][ALT]: %s' % (item.category.capitalize(), title_gen) - elif config.get_setting("quit_channel_name", "videolibrary") == 1 and item.contentChannel == "videolibrary": + elif (config.get_setting("quit_channel_name", "videolibrary") == 1 or item.channel == channel_py) and item.contentChannel == "videolibrary": title_gen = '%s: %s' % (item.category.capitalize(), title_gen) #Pintamos el pseudo-título con toda la información disponible del vídeo diff --git a/plugin.video.alfa/platformcode/xbmc_config_menu.py b/plugin.video.alfa/platformcode/xbmc_config_menu.py index 6990071b..25c2f807 100755 --- a/plugin.video.alfa/platformcode/xbmc_config_menu.py +++ b/plugin.video.alfa/platformcode/xbmc_config_menu.py @@ -111,7 +111,7 @@ class SettingsWindow(xbmcgui.WindowXMLDialog): ] } - Los campos 'label', 'default' y 'lvalues' pueden ser un numero precedido de '@'. En cuyo caso se + Los campos 'label', 'default', 'enabled' y 'lvalues' pueden ser un numero precedido de '@'. En cuyo caso se buscara el literal en el archivo string.xml del idioma seleccionado. Los campos 'enabled' y 'visible' admiten los comparadores eq(), gt() e it() y su funcionamiento se describe en: http://kodi.wiki/view/Add-on_settings#Different_types @@ -273,6 +273,9 @@ class SettingsWindow(xbmcgui.WindowXMLDialog): if c["type"] == "label": control_value = c["control"].getLabel() + if value.startswith('@') and unicode(value[1:]).isnumeric(): + value = config.get_localized_string(int(value[1:])) + # Operaciones lt "menor que" y gt "mayor que", requieren que las comparaciones sean numeros, sino devuelve # False if operator in ["lt", "!lt", "gt", "!gt"]: diff --git a/plugin.video.alfa/platformcode/xbmc_videolibrary.py b/plugin.video.alfa/platformcode/xbmc_videolibrary.py index 6867f5a8..079099ff 100755 --- a/plugin.video.alfa/platformcode/xbmc_videolibrary.py +++ b/plugin.video.alfa/platformcode/xbmc_videolibrary.py @@ -235,8 +235,10 @@ def mark_content_as_watched_on_kodi(item, value=1): data = get_data(payload) if 'result' in data and "movies" in data['result']: - filename = filetools.basename(item.strm_path) - head, tail = filetools.split(filetools.split(item.strm_path)[0]) + #filename = filetools.basename(item.strm_path) + #head, tail = filetools.split(filetools.split(item.strm_path)[0]) + filename = filetools.basename(item.path) + head, tail = filetools.split(filetools.split(item.path)[0]) path = filetools.join(tail, filename) for d in data['result']['movies']: @@ -258,8 +260,10 @@ def mark_content_as_watched_on_kodi(item, value=1): data = get_data(payload) if 'result' in data and "episodes" in data['result']: - filename = filetools.basename(item.strm_path) - head, tail = filetools.split(filetools.split(item.strm_path)[0]) + #filename = filetools.basename(item.strm_path) + #head, tail = filetools.split(filetools.split(item.strm_path)[0]) + filename = filetools.basename(item.path) + head, tail = filetools.split(filetools.split(item.path)[0]) path = filetools.join(tail, filename) for d in data['result']['episodes']: