summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVitiko <[email protected]>2021-12-14 15:58:50 -0400
committerVitiko <[email protected]>2021-12-14 15:58:50 -0400
commitb5c66e1470991ac6896b311096a78c8bef21ef9e (patch)
treeec405f0c101c23659d29e3c5d31ddfee13c8c9e5
parent9b74ad8610f35275e76b9374643d768c6ef8df53 (diff)
downloadbazarr-b5c66e1470991ac6896b311096a78c8bef21ef9e.tar.gz
bazarr-b5c66e1470991ac6896b311096a78c8bef21ef9e.zip
Embedded Subtitles Provider: rebuild language if forcedv1.0.2-beta.8
-rw-r--r--libs/subliminal_patch/providers/embeddedsubtitles.py3
-rw-r--r--tests/subliminal_patch/test_embeddedsubtitles.py1
2 files changed, 4 insertions, 0 deletions
diff --git a/libs/subliminal_patch/providers/embeddedsubtitles.py b/libs/subliminal_patch/providers/embeddedsubtitles.py
index 3d9e64959..aa8927fd6 100644
--- a/libs/subliminal_patch/providers/embeddedsubtitles.py
+++ b/libs/subliminal_patch/providers/embeddedsubtitles.py
@@ -30,6 +30,9 @@ class EmbeddedSubtitle(Subtitle):
def __init__(self, stream, container, matches):
super().__init__(stream.language, stream.disposition.hearing_impaired)
+ if stream.disposition.forced:
+ self.language = Language.rebuild(stream.language, forced=True)
+
self.stream: FFprobeSubtitleStream = stream
self.container: FFprobeVideoContainer = container
self.forced = stream.disposition.forced
diff --git a/tests/subliminal_patch/test_embeddedsubtitles.py b/tests/subliminal_patch/test_embeddedsubtitles.py
index ee1c8d6eb..6c546a61f 100644
--- a/tests/subliminal_patch/test_embeddedsubtitles.py
+++ b/tests/subliminal_patch/test_embeddedsubtitles.py
@@ -82,6 +82,7 @@ def test_list_subtitles_also_forced(video_single_language):
language_2 = Language.rebuild(language_1, forced=True)
subs = provider.list_subtitles(video_single_language, {language_1, language_2})
assert any(language_1 == sub.language for sub in subs)
+ assert any(not sub.language.forced for sub in subs)
def test_list_subtitles_single_language(video_single_language):