Embedded Subtitles provider: Fix #2171

pull/2131/head
Vitiko 2 years ago
parent a82f52f84b
commit 6ac5bc7d4d

@ -45,10 +45,9 @@ class EmbeddedSubtitle(Subtitle):
self._matches: set = matches self._matches: set = matches
def get_matches(self, video): def get_matches(self, video):
if self.hearing_impaired: self._matches.add("hearing_impaired")
self._matches.add("hearing_impaired")
self._matches.add("hash") self._matches.add("hash")
return self._matches return self._matches
@property @property

@ -184,7 +184,7 @@ def test_list_subtitles_hi_fallback_one_stream(
fake = _MemoizedFFprobeVideoContainer.get_subtitles("")[0] fake = _MemoizedFFprobeVideoContainer.get_subtitles("")[0]
assert fake.disposition.hearing_impaired == True assert fake.disposition.hearing_impaired == True
subs = provider.list_subtitles(video_single_language, {language}) subs = provider.list_subtitles(video_single_language, {language})
assert subs assert subs[0].language == Language("eng", hi=False)
assert subs[0].hearing_impaired == 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}) subs = provider.list_subtitles(video_single_language, {language})
assert len(subs) == 2 assert len(subs) == 2
assert subs[0].hearing_impaired == True assert subs[0].language == Language("eng", hi=True)
assert subs[1].hearing_impaired == False assert subs[1].language == Language("eng", hi=False)
def test_list_subtitles_hi_fallback_multiple_language_streams( def test_list_subtitles_hi_fallback_multiple_language_streams(

Loading…
Cancel
Save