From b76190c0292b02d3f37bbe1f01a41136ee261bf9 Mon Sep 17 00:00:00 2001 From: Kingbox <37674310+lopezvg@users.noreply.github.com> Date: Wed, 20 Jun 2018 18:59:21 +0200 Subject: [PATCH] =?UTF-8?q?Mejoras=20de=20gesti=C3=B3n=20de=20t=C3=ADtulos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin.video.alfa/channels/grantorrent.py | 2 +- plugin.video.alfa/lib/generictools.py | 25 +++++++++++------------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/plugin.video.alfa/channels/grantorrent.py b/plugin.video.alfa/channels/grantorrent.py index 1bc7498c..f2534bd9 100644 --- a/plugin.video.alfa/channels/grantorrent.py +++ b/plugin.video.alfa/channels/grantorrent.py @@ -735,7 +735,7 @@ def episodios(item): else: #episodio normal item_local.title = '%sx%s -' % (item_local.contentSeason, str(item_local.contentEpisodeNumber).zfill(2)) - if len(itemlist) > 0 and item_local.contentSeason == itemlist[-1].contentSeason and item_local.contentEpisodeNumber == itemlist[-1].contentEpisodeNumber and not "Temporada" in itemlist[-1].title and itemlist[-1].contentEpisodeNumber != 0: #solo guardamos un episodio ... + if len(itemlist) > 0 and item_local.contentSeason == itemlist[-1].contentSeason and item_local.contentEpisodeNumber == itemlist[-1].contentEpisodeNumber and item_local.title == itemlist[-1].title and itemlist[-1].contentEpisodeNumber != 0: #solo guardamos un episodio ... if itemlist[-1].quality: itemlist[-1].quality += ", " + quality #... pero acumulamos las calidades else: diff --git a/plugin.video.alfa/lib/generictools.py b/plugin.video.alfa/lib/generictools.py index 5966cb98..2423a84b 100644 --- a/plugin.video.alfa/lib/generictools.py +++ b/plugin.video.alfa/lib/generictools.py @@ -318,24 +318,23 @@ def post_tmdb_episodios(item, itemlist): #Preparamos el título para que sea compatible con Añadir Serie a Videoteca if item.infoLabels['title']: del item.infoLabels['title'] - if item_local.infoLabels['episodio_titulo']: - if "al" in item_local.title: #Si son episodios múltiples, ponemos nombre de serie - if "al 99" in item_local.title.lower(): #Temporada completa. Buscamos num. total de episodios de la temporada - item_local.title = item_local.title.replace("99", str(num_episodios)) - item_local.title = '%s %s' % (item_local.title, item_local.contentSerieName) - item_local.infoLabels['episodio_titulo'] = '%s - %s' % (scrapertools.find_single_match(item_local.title, r'(al \d+)'), item_local.contentSerieName) - else: - item_local.title = '%s %s' % (item_local.title, item_local.infoLabels['episodio_titulo']) + if "Temporada" in item_local.title: #Compatibilizamos "Temporada" con Unify + item_local.title = '%sx%s al 99 -' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber)) + if " al " in item_local.title: #Si son episodios múltiples, ponemos nombre de serie + if " al 99" in item_local.title.lower(): #Temporada completa. Buscamos num total de episodios de la temporada + item_local.title = item_local.title.replace("99", str(num_episodios)) + item_local.title = '%s %s' % (item_local.title, item_local.contentSerieName) + item_local.infoLabels['episodio_titulo'] = '%s - %s [%s] [%s]' % (scrapertools.find_single_match(item_local.title, r'(al \d+)'), item_local.contentSerieName, item_local.infoLabels['year'], rating) + + elif item_local.infoLabels['episodio_titulo']: + item_local.title = '%s %s' % (item_local.title, item_local.infoLabels['episodio_titulo']) item_local.infoLabels['episodio_titulo'] = '%s [%s] [%s]' % (item_local.infoLabels['episodio_titulo'], item_local.infoLabels['year'], rating) else: #Si no hay título de episodio, ponermos el nombre de la serie item_local.title = '%s %s' % (item_local.title, item_local.contentSerieName) - if "Temporada" in item_local.title: - item_local.infoLabels['episodio_titulo'] = '%s - %s [%s] [%s]' % (scrapertools.find_single_match(item_local.title, r'(Temporada \d+ Completa)'), item_local.contentSerieName, item_local.infoLabels['year'], rating) - else: - item_local.infoLabels['episodio_titulo'] = '%s [%s] [%s]' % (item_local.contentSerieName, item_local.infoLabels['year'], rating) - item_local.infoLabels['title'] = item_local.infoLabels['episodio_titulo'] + item_local.infoLabels['episodio_titulo'] = '%s [%s] [%s]' % (item_local.contentSerieName, item_local.infoLabels['year'], rating) + #item_local.infoLabels['title'] = item_local.infoLabels['episodio_titulo'] #Componemos el título final, aunque con Unify usará infoLabels['episodio_titulo'] item_local.title = '%s [%s] [%s] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (item_local.title, item_local.infoLabels['year'], rating, item_local.quality, str(item_local.language))