mirror of https://github.com/morpheus65535/bazarr
Fix for #1253.
This commit is contained in:
parent
f93af2f3e0
commit
d9b9a6265d
|
@ -316,32 +316,44 @@ def get_audio_profile_languages(series_id=None, episode_id=None, movie_id=None):
|
|||
if series_id:
|
||||
audio_languages_list_str = database.execute("SELECT audio_language FROM table_shows WHERE sonarrSeriesId=?",
|
||||
(series_id,), only_one=True)['audio_language']
|
||||
audio_languages_list = ast.literal_eval(audio_languages_list_str)
|
||||
for language in audio_languages_list:
|
||||
audio_languages.append(
|
||||
{"name": language,
|
||||
"code2": alpha2_from_language(language) or None,
|
||||
"code3": alpha3_from_language(language) or None}
|
||||
)
|
||||
try:
|
||||
audio_languages_list = ast.literal_eval(audio_languages_list_str)
|
||||
except ValueError:
|
||||
pass
|
||||
else:
|
||||
for language in audio_languages_list:
|
||||
audio_languages.append(
|
||||
{"name": language,
|
||||
"code2": alpha2_from_language(language) or None,
|
||||
"code3": alpha3_from_language(language) or None}
|
||||
)
|
||||
elif episode_id:
|
||||
audio_languages_list_str = database.execute("SELECT audio_language FROM table_episodes WHERE sonarrEpisodeId=?",
|
||||
(episode_id,), only_one=True)['audio_language']
|
||||
audio_languages_list = ast.literal_eval(audio_languages_list_str)
|
||||
for language in audio_languages_list:
|
||||
audio_languages.append(
|
||||
{"name": language,
|
||||
"code2": alpha2_from_language(language) or None,
|
||||
"code3": alpha3_from_language(language) or None}
|
||||
)
|
||||
try:
|
||||
audio_languages_list = ast.literal_eval(audio_languages_list_str)
|
||||
except ValueError:
|
||||
pass
|
||||
else:
|
||||
for language in audio_languages_list:
|
||||
audio_languages.append(
|
||||
{"name": language,
|
||||
"code2": alpha2_from_language(language) or None,
|
||||
"code3": alpha3_from_language(language) or None}
|
||||
)
|
||||
elif movie_id:
|
||||
audio_languages_list_str = database.execute("SELECT audio_language FROM table_movies WHERE radarrId=?",
|
||||
(movie_id,), only_one=True)['audio_language']
|
||||
audio_languages_list = ast.literal_eval(audio_languages_list_str)
|
||||
for language in audio_languages_list:
|
||||
audio_languages.append(
|
||||
{"name": language,
|
||||
"code2": alpha2_from_language(language) or None,
|
||||
"code3": alpha3_from_language(language) or None}
|
||||
)
|
||||
try:
|
||||
audio_languages_list = ast.literal_eval(audio_languages_list_str)
|
||||
except ValueError:
|
||||
pass
|
||||
else:
|
||||
for language in audio_languages_list:
|
||||
audio_languages.append(
|
||||
{"name": language,
|
||||
"code2": alpha2_from_language(language) or None,
|
||||
"code3": alpha3_from_language(language) or None}
|
||||
)
|
||||
|
||||
return audio_languages
|
||||
|
|
|
@ -1375,6 +1375,8 @@ def upgrade_subtitles():
|
|||
history_log_movie(3, movie['radarrId'], message, path, language_code, provider, score, subs_id, subs_path)
|
||||
send_notifications_movie(movie['radarrId'], message)
|
||||
|
||||
logging.info('BAZARR Finished searching for Subtitles to upgrade. Check History for more information.')
|
||||
|
||||
|
||||
def postprocessing(command, path):
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue