Skip to content

Commit

Permalink
Fixed improper subtitles being downloaded when HI is required by lang…
Browse files Browse the repository at this point in the history
…uages profile. #2293
  • Loading branch information
morpheus65535 committed Nov 10, 2023
1 parent cb3a274 commit 0f19d79
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bazarr/subtitles/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def generate_subtitles(path, languages, audio_language, sceneName, title, media_
providers = pool.providers

language_set = _get_language_obj(languages=languages)
hi_required = any([x.hi for x in language_set])
hi_required = "force HI" if any([x.hi for x in language_set]) else False
also_forced = any([x.forced for x in language_set])
forced_required = all([x.forced for x in language_set])
_set_forced_providers(pool=pool, also_forced=also_forced, forced_required=forced_required)
Expand Down
1 change: 1 addition & 0 deletions libs/subliminal_patch/providers/embeddedsubtitles.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
class EmbeddedSubtitle(Subtitle):
provider_name = "embeddedsubtitles"
hash_verifiable = False
hearing_impaired_verifiable = True

def __init__(self, stream, container, matches, media_type):
super().__init__(stream.language, stream.disposition.hearing_impaired)
Expand Down
1 change: 1 addition & 0 deletions libs/subliminal_patch/providers/gestdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
class GestdownSubtitle(Subtitle):
provider_name = "gestdown"
hash_verifiable = False
hearing_impaired_verifiable = True

def __init__(self, language, data: dict):
super().__init__(language, hearing_impaired=data["hearingImpaired"])
Expand Down
1 change: 1 addition & 0 deletions libs/subliminal_patch/providers/hdbits.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
class HDBitsSubtitle(Subtitle):
provider_name = "hdbits"
hash_verifiable = False
hearing_impaired_verifiable = True

def __init__(self, language, id, name, filename, matches=None, episode=None):
super().__init__(language, hearing_impaired=language.hi)
Expand Down
3 changes: 2 additions & 1 deletion libs/subliminal_patch/providers/opensubtitlescom.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def from_opensubtitlescom(lang):

class OpenSubtitlesComSubtitle(Subtitle):
provider_name = 'opensubtitlescom'
hash_verifiable = False
hash_verifiable = True
hearing_impaired_verifiable = True

def __init__(self, language, forced, hearing_impaired, page_link, file_id, releases, uploader, title, year,
hash_matched, file_hash=None, season=None, episode=None, imdb_match=False):
Expand Down
1 change: 1 addition & 0 deletions libs/subliminal_patch/providers/yifysubtitles.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
class YifySubtitle(Subtitle):
"""YIFY Subtitles"""
provider_name = 'yifysubtitles'
hearing_impaired_verifiable = True

def __init__(self, language, page_link, release, uploader, rating, hi):
super(YifySubtitle, self).__init__(language)
Expand Down

0 comments on commit 0f19d79

Please sign in to comment.