Merge remote-tracking branch 'origin/development' into development

This commit is contained in:
morpheus65535 2022-05-14 09:39:41 -04:00
commit 2710bfa17d
2 changed files with 11 additions and 10 deletions

View file

@ -143,11 +143,13 @@ def _get_language_obj(languages):
def _set_forced_providers(forced_required, pool): def _set_forced_providers(forced_required, pool):
# TODO: maybe a separate pool for forced configs? only_foreign is hardcoded
# in get_providers and this causes updating the pool on every call
if forced_required: if forced_required:
pool.provider_configs['podnapisi']['only_foreign'] = True pool.provider_configs.update(
pool.provider_configs['subscene']['only_foreign'] = True {
pool.provider_configs['opensubtitles']['only_foreign'] = True "podnapisi": {"only_foreign": True},
else: "subscene": {"only_foreign": True},
pool.provider_configs['podnapisi']['only_foreign'] = False "opensubtitles": {"only_foreign": True}
pool.provider_configs['subscene']['only_foreign'] = False }
pool.provider_configs['opensubtitles']['only_foreign'] = False )

View file

@ -56,10 +56,9 @@ def manual_search(path, profile_id, providers, sceneName, title, media_type):
if language.forced: if language.forced:
subscene_language_set.add(language) subscene_language_set.add(language)
if len(subscene_language_set): if len(subscene_language_set):
s_pool.provider_configs['subscene'] = {} s_pool.provider_configs.update({"subscene": {"only_foreign": True}})
s_pool.provider_configs['subscene']['only_foreign'] = True
subtitles_subscene = list_all_subtitles([video], subscene_language_set, s_pool) subtitles_subscene = list_all_subtitles([video], subscene_language_set, s_pool)
s_pool.provider_configs['subscene']['only_foreign'] = False s_pool.provider_configs.update({"subscene": {"only_foreign": False}})
subtitles[video] += subtitles_subscene[video] subtitles[video] += subtitles_subscene[video]
else: else:
subtitles = [] subtitles = []