core: update to subliminal_patch:head; addic7ed: fix using empty show ids list; fix completed subtitle detection for non-english languages; fix mr robot subtitle file detection

pull/684/head
panni 5 years ago
parent 4f8ddb6467
commit 912717dd93

@ -627,7 +627,7 @@ def _search_external_subtitles(path, languages=None, only_one=False, scandir_gen
try:
language = Language.fromietf(language_code)
language.forced = forced
except ValueError:
except (ValueError, LanguageReverseError):
logger.error('Cannot parse language code %r', language_code)
language_code = None
except IndexError:

@ -178,14 +178,13 @@ class Addic7edProvider(_Addic7edProvider):
:rtype: int
"""
show_id = None
show_ids = {sanitize(series).lower(), sanitize(series.replace(".", "")).lower()}
logger.debug("Trying show ids: %s", show_ids)
for series_sanitized in show_ids:
if not ignore_cache:
show_ids = self._get_show_ids()
else:
show_ids = self._get_show_ids.refresh(self)
ids_to_look_for = {sanitize(series).lower(), sanitize(series.replace(".", "")).lower()}
show_ids = self._get_show_ids()
if ignore_cache or not show_ids:
show_ids = self._get_show_ids.refresh(self)
logger.debug("Trying show ids: %s", ids_to_look_for)
for series_sanitized in ids_to_look_for:
# attempt with country
if not show_id and country_code:
logger.debug('Getting show id with country')
@ -265,6 +264,9 @@ class Addic7edProvider(_Addic7edProvider):
logger.debug('Found %d show ids', len(show_ids))
if not show_ids:
raise Exception("Addic7ed: No show IDs found!")
return show_ids
@region.cache_on_arguments(expiration_time=SHOW_EXPIRATION_TIME)
@ -364,7 +366,7 @@ class Addic7edProvider(_Addic7edProvider):
# ignore incomplete subtitles
status = cells[5].text
if status != 'Completed':
if "%" in status:
logger.debug('Ignoring subtitle with status %s', status)
continue

Loading…
Cancel
Save