aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVitiko <[email protected]>2023-06-13 17:53:51 -0400
committerVitiko <[email protected]>2023-06-13 17:53:51 -0400
commit6ac5bc7d4d7717254fc6de2a2b176a372f73378c (patch)
treeefdda56b82d60f85c47f144d8ba75c89cb84690a
parenta82f52f84bdc1659f15f3d4131f5cc1f7a3ead6d (diff)
downloadbazarr-6ac5bc7d4d7717254fc6de2a2b176a372f73378c.tar.gz
bazarr-6ac5bc7d4d7717254fc6de2a2b176a372f73378c.zip
Embedded Subtitles provider: Fix #2171
-rw-r--r--libs/subliminal_patch/providers/embeddedsubtitles.py5
-rw-r--r--tests/subliminal_patch/test_embeddedsubtitles.py6
2 files changed, 5 insertions, 6 deletions
diff --git a/libs/subliminal_patch/providers/embeddedsubtitles.py b/libs/subliminal_patch/providers/embeddedsubtitles.py
index 01f92f907..2342c1541 100644
--- a/libs/subliminal_patch/providers/embeddedsubtitles.py
+++ b/libs/subliminal_patch/providers/embeddedsubtitles.py
@@ -45,10 +45,9 @@ class EmbeddedSubtitle(Subtitle):
self._matches: set = matches
def get_matches(self, video):
- if self.hearing_impaired:
- self._matches.add("hearing_impaired")
-
+ self._matches.add("hearing_impaired")
self._matches.add("hash")
+
return self._matches
@property
diff --git a/tests/subliminal_patch/test_embeddedsubtitles.py b/tests/subliminal_patch/test_embeddedsubtitles.py
index 2c04aa377..ae7641a5f 100644
--- a/tests/subliminal_patch/test_embeddedsubtitles.py
+++ b/tests/subliminal_patch/test_embeddedsubtitles.py
@@ -184,7 +184,7 @@ def test_list_subtitles_hi_fallback_one_stream(
fake = _MemoizedFFprobeVideoContainer.get_subtitles("")[0]
assert fake.disposition.hearing_impaired == True
subs = provider.list_subtitles(video_single_language, {language})
- assert subs
+ assert subs[0].language == Language("eng", hi=False)
assert subs[0].hearing_impaired == False
@@ -200,8 +200,8 @@ def test_list_subtitles_hi_fallback_multiple_streams(
)
subs = provider.list_subtitles(video_single_language, {language})
assert len(subs) == 2
- assert subs[0].hearing_impaired == True
- assert subs[1].hearing_impaired == False
+ assert subs[0].language == Language("eng", hi=True)
+ assert subs[1].language == Language("eng", hi=False)
def test_list_subtitles_hi_fallback_multiple_language_streams(