mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-23 08:13:14 +00:00
Update language equals mechanism
This commit will avoid the core requesting languages that are not supported by providers.
This commit is contained in:
parent
6ac5bc7d4d
commit
2b0e435f6a
1 changed files with 8 additions and 2 deletions
|
@ -330,6 +330,8 @@ class SZProviderPool(ProviderPool):
|
||||||
:rtype: list of :class:`~subliminal.subtitle.Subtitle` or None
|
:rtype: list of :class:`~subliminal.subtitle.Subtitle` or None
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
logger.debug("Languages requested: %s", languages)
|
||||||
|
|
||||||
if self.language_hook:
|
if self.language_hook:
|
||||||
languages_search_base = self.language_hook(provider)
|
languages_search_base = self.language_hook(provider)
|
||||||
else:
|
else:
|
||||||
|
@ -354,10 +356,14 @@ class SZProviderPool(ProviderPool):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
# list subtitles
|
# list subtitles
|
||||||
logger.info('Listing subtitles with provider %r and languages %r', provider, provider_languages)
|
|
||||||
results = []
|
results = []
|
||||||
|
|
||||||
|
to_request = self.lang_equals.translate(provider_languages) & set(provider_registry[provider].languages)
|
||||||
|
|
||||||
|
logger.info('Listing subtitles with provider %r and languages %r', provider, to_request)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
results = self[provider].list_subtitles(video, self.lang_equals.translate(provider_languages))
|
results = self[provider].list_subtitles(video, to_request)
|
||||||
seen = []
|
seen = []
|
||||||
out = []
|
out = []
|
||||||
for s in results:
|
for s in results:
|
||||||
|
|
Loading…
Reference in a new issue