1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2025-01-31 03:12:12 +00:00

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

This commit is contained in:
panni 2019-10-22 12:00:50 +02:00
parent 4f8ddb6467
commit 912717dd93
2 changed files with 11 additions and 9 deletions

View file

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

View file

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