list_subtitles: use configured language list as fallback when searching external subtitles

pull/489/head
panni 6 years ago
parent 0a954e5a92
commit 8a1baa2d24

@ -16,7 +16,7 @@ from bs4 import UnicodeDammit
from itertools import islice from itertools import islice
from get_args import args from get_args import args
from get_languages import alpha2_from_alpha3 from get_languages import alpha2_from_alpha3, get_languages
from config import settings from config import settings
from helper import path_replace, path_replace_movie, path_replace_reverse, \ from helper import path_replace, path_replace_movie, path_replace_reverse, \
path_replace_reverse_movie path_replace_reverse_movie
@ -56,7 +56,8 @@ def store_subtitles(file):
try: try:
# fixme: set subliminal_patch.core.CUSTOM_PATHS to a list of absolute folders or subfolders to support # fixme: set subliminal_patch.core.CUSTOM_PATHS to a list of absolute folders or subfolders to support
# subtitles outside the media file folder # subtitles outside the media file folder
subtitles = search_external_subtitles(file, only_one=settings.general.getboolean('single_language')) subtitles = search_external_subtitles(file, languages=get_languages(kind="code3"),
only_one=settings.general.getboolean('single_language'))
except Exception as e: except Exception as e:
logging.exception("BAZARR unable to index external subtitles.") logging.exception("BAZARR unable to index external subtitles.")
pass pass
@ -139,7 +140,8 @@ def store_subtitles_movie(file):
# subtitles outside the media file folder # subtitles outside the media file folder
brazilian_portuguese = [".pt-br", ".pob", "pb"] brazilian_portuguese = [".pt-br", ".pob", "pb"]
try: try:
subtitles = search_external_subtitles(file, only_one=settings.general.getboolean('single_language')) subtitles = search_external_subtitles(file, languages=get_languages(kind="code3"),
only_one=settings.general.getboolean('single_language'))
except Exception as e: except Exception as e:
logging.exception("BAZARR unable to index external subtitles.") logging.exception("BAZARR unable to index external subtitles.")
pass pass

Loading…
Cancel
Save