1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-27 10:07:22 +00:00
This commit is contained in:
Louis Vézina 2018-10-11 22:24:27 -04:00
parent fe283d3cd9
commit b256c5f341

View file

@ -102,6 +102,7 @@ def download_subtitle(path, language, hi, providers, providers_auth, sceneName,
logging.exception('Error saving subtitles file to disk.') logging.exception('Error saving subtitles file to disk.')
return None return None
else: else:
if len(result) > 0:
downloaded_provider = result[0].provider_name downloaded_provider = result[0].provider_name
downloaded_language = language_from_alpha3(result[0].language.alpha3) downloaded_language = language_from_alpha3(result[0].language.alpha3)
downloaded_language_code2 = alpha2_from_alpha3(result[0].language.alpha3) downloaded_language_code2 = alpha2_from_alpha3(result[0].language.alpha3)
@ -142,6 +143,8 @@ def download_subtitle(path, language, hi, providers, providers_auth, sceneName,
return message return message
else: else:
return None return None
else:
return None
def manual_search(path, language, hi, providers, providers_auth, sceneName, media_type): def manual_search(path, language, hi, providers, providers_auth, sceneName, media_type):
if hi == "True": if hi == "True":
@ -260,6 +263,7 @@ def manual_download_subtitle(path, language, hi, subtitle, provider, providers_a
logging.exception('Error saving subtitles file to disk.') logging.exception('Error saving subtitles file to disk.')
return None return None
else: else:
if len(result) > 0:
downloaded_provider = result[0].provider_name downloaded_provider = result[0].provider_name
downloaded_language = language_from_alpha3(result[0].language.alpha3) downloaded_language = language_from_alpha3(result[0].language.alpha3)
downloaded_language_code2 = alpha2_from_alpha3(result[0].language.alpha3) downloaded_language_code2 = alpha2_from_alpha3(result[0].language.alpha3)
@ -295,6 +299,8 @@ def manual_download_subtitle(path, language, hi, subtitle, provider, providers_a
logging.info('Post-processing result for file ' + path + ' : ' + out) logging.info('Post-processing result for file ' + path + ' : ' + out)
return message return message
else:
return None
def series_download_subtitles(no): def series_download_subtitles(no):
if get_general_settings()[24] is True: if get_general_settings()[24] is True: