Altri fix per TVDB e Autorenumber

This commit is contained in:
Alhaziel01
2020-11-09 19:46:53 +01:00
parent f88ca6e560
commit e8c06af550
3 changed files with 12 additions and 8 deletions

View File

@@ -94,11 +94,13 @@ def find_and_set_infoLabels(item):
title = title.replace(year, "").strip()
item.infoLabels['year'] = year[1:-1]
if not item.infoLabels.get("tvdb_id"):
if not item.infoLabels.get("imdb_id"):
if item.infoLabels.get("tvdb_id") in ['', 'None']:
if item.infoLabels['year']:
otvdb_global = Tvdb(search=title, year=item.infoLabels['year'])
else:
elif item.infoLabels.get("imdb_id"):
otvdb_global = Tvdb(imdb_id=item.infoLabels.get("imdb_id"))
else:
otvdb_global = Tvdb(search=title)
elif not otvdb_global or otvdb_global.get_id() != item.infoLabels['tvdb_id']:
otvdb_global = Tvdb(tvdb_id=item.infoLabels['tvdb_id'])
@@ -117,7 +119,7 @@ def find_and_set_infoLabels(item):
if not tvdb_result:
res = platformtools.dialog_info(item, 'tvdb')
if not res.exit: return find_and_set_infoLabels(res)
elif len(results) > 0:
elif len(results) > 0 and results[0]['seriesId']:
tvdb_result = results[0]
else:
@@ -818,7 +820,7 @@ class Tvdb(object):
else:
dict_html = req.json()
if "errors" in dict_html and "invalidLanguage" in dict_html["errors"]:
if "Error" in dict_html and "invalidLanguage" in dict_html["Error"]:
return {}
resultado1 = dict_html["data"]
if not resultado1 and from_get_list:

View File

@@ -1079,7 +1079,7 @@ def add_tvshow(item, channel=None):
# Get the episode list
# from core.support import dbg;dbg()
itemlist = getattr(channel, item.action)(item)
if itemlist and not scrapertools.find_single_match(itemlist[0].title, r'[Ss]?(\d+)(?:x|_|\.|\s+)?[Ee]?[Pp]?(\d+)'):
if itemlist and not scrapertools.find_single_match(itemlist[0].title, r'[Ss]?(\d+)(?:x|_|\.|\s+)[Ee]?[Pp]?(\d+)'):
from platformcode.autorenumber import start, check
if not check(item):
action = item.action
@@ -1087,7 +1087,8 @@ def add_tvshow(item, channel=None):
start(item)
item.renumber = False
item.action = action
return add_tvshow(item, channel)
if not item.exit:
return add_tvshow(item, channel)
else:
itemlist = getattr(channel, item.action)(item)

View File

@@ -107,7 +107,8 @@ class autorenumber():
if self.item:
self.auto = config.get_setting('autorenumber', item.channel)
self.title = self.item.fulltitle.strip()
if match(self.itemlist[0].title, patron=r'(\d+\D\d+)').match:
if match(self.itemlist[0].title, patron=r'[Ss]?(\d+)(?:x|_|\.|\s+)[Ee]?[Pp]?(\d+)').match:
item.exit = True
return
elif self.item.channel in self.item.channel_prefs and TVSHOW_RENUMERATE in self.item.channel_prefs[item.channel] and self.title not in self.dictSeries:
from core.videolibrarytools import check_renumber_options