aboutsummaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
authorMrHereAndThere <[email protected]>2024-02-20 09:10:27 +0700
committerGitHub <[email protected]>2024-02-19 21:10:27 -0500
commitad8f116c78688ab038e834a8ad3a3b4c7bfee0c6 (patch)
tree3734b73ac800a5af6383599b2ba5419c388fc79d /libs
parent5dd001317dc6e88885b392f9fe5107e324593f99 (diff)
downloadbazarr-ad8f116c78688ab038e834a8ad3a3b4c7bfee0c6.tar.gz
bazarr-ad8f116c78688ab038e834a8ad3a3b4c7bfee0c6.zip
Updated fallback language for embeddedsubtitles provider to be able to specify the one to use
Diffstat (limited to 'libs')
-rw-r--r--libs/subliminal_patch/providers/embeddedsubtitles.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/libs/subliminal_patch/providers/embeddedsubtitles.py b/libs/subliminal_patch/providers/embeddedsubtitles.py
index 045347563..7fbf1bef8 100644
--- a/libs/subliminal_patch/providers/embeddedsubtitles.py
+++ b/libs/subliminal_patch/providers/embeddedsubtitles.py
@@ -85,7 +85,8 @@ class EmbeddedSubtitlesProvider(Provider):
ffmpeg_path=None,
hi_fallback=False,
timeout=600,
- unknown_as_english=False,
+ unknown_as_fallback=False,
+ fallback_lang="en",
):
self._included_codecs = set(included_codecs or _ALLOWED_CODECS)
@@ -97,7 +98,8 @@ class EmbeddedSubtitlesProvider(Provider):
cache_dir or tempfile.gettempdir(), self.__class__.__name__.lower()
)
self._hi_fallback = hi_fallback
- self._unknown_as_english = unknown_as_english
+ self._unknown_as_fallback = unknown_as_fallback
+ self._fallback_lang = fallback_lang
self._cached_paths = {}
self._timeout = int(timeout)
@@ -110,7 +112,7 @@ class EmbeddedSubtitlesProvider(Provider):
# Default is True
container.FFMPEG_STATS = False
- tags.LANGUAGE_FALLBACK = "en" if self._unknown_as_english else None
+ tags.LANGUAGE_FALLBACK = self._fallback_lang if self._unknown_as_fallback and self._fallback_lang else None
logger.debug("Language fallback set: %s", tags.LANGUAGE_FALLBACK)
def initialize(self):