Skip to content

Commit

Permalink
Fixed cutoff language not being properly handled. #2635
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheus65535 committed Aug 30, 2024
1 parent 0fd635c commit 5f7e1f6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions bazarr/subtitles/indexer/movies.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,20 @@ def list_missing_subtitles_movies(no=None, send_event=True):

if cutoff_temp_list:
for cutoff_temp in cutoff_temp_list:
cutoff_language = [cutoff_temp['language'], cutoff_temp['forced'], cutoff_temp['hi']]
cutoff_language = {'language': cutoff_temp['language'],
'forced': cutoff_temp['forced'],
'hi': cutoff_temp['hi']}
if cutoff_temp['audio_exclude'] == 'True' and \
any(x['code2'] == cutoff_temp['language'] for x in
get_audio_profile_languages(movie_subtitles.audio_language)):
cutoff_met = True
elif cutoff_language in actual_subtitles_list:
cutoff_met = True
# HI is considered as good as normal
elif cutoff_language and [cutoff_language[0], 'False', 'True'] in actual_subtitles_list:
elif (cutoff_language and
{'language': cutoff_language['language'],
'forced': 'False',
'hi': 'True'} in actual_subtitles_list):
cutoff_met = True

if cutoff_met:
Expand Down
9 changes: 7 additions & 2 deletions bazarr/subtitles/indexer/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,20 @@ def list_missing_subtitles(no=None, epno=None, send_event=True):

if cutoff_temp_list:
for cutoff_temp in cutoff_temp_list:
cutoff_language = [cutoff_temp['language'], cutoff_temp['forced'], cutoff_temp['hi']]
cutoff_language = {'language': cutoff_temp['language'],
'forced': cutoff_temp['forced'],
'hi': cutoff_temp['hi']}
if cutoff_temp['audio_exclude'] == 'True' and \
any(x['code2'] == cutoff_temp['language'] for x in
get_audio_profile_languages(episode_subtitles.audio_language)):
cutoff_met = True
elif cutoff_language in actual_subtitles_list:
cutoff_met = True
# HI is considered as good as normal
elif [cutoff_language[0], 'False', 'True'] in actual_subtitles_list:
elif (cutoff_language and
{'language': cutoff_language['language'],
'forced': 'False',
'hi': 'True'} in actual_subtitles_list):
cutoff_met = True

if cutoff_met:
Expand Down

0 comments on commit 5f7e1f6

Please sign in to comment.