Continuing development.

pull/380/head
Louis Vézina 6 years ago
parent 3cc39c08da
commit dd17672593

@ -111,7 +111,7 @@ def download_subtitle(path, language, hi, providers, providers_auth, sceneName,
else:
hi = False
language_set = set()
original_language = language
if not isinstance(language, types.ListType):
language = [language]
@ -184,9 +184,12 @@ def download_subtitle(path, language, hi, providers, providers_auth, sceneName,
saved_any = True
for subtitle in saved_subtitles:
downloaded_provider = subtitle.provider_name
downloaded_language = language_from_alpha3(original_language)
downloaded_language_code2 = alpha2_from_alpha3(original_language)
downloaded_language_code3 = original_language
if subtitle.language == 'pt-BR':
downloaded_language_code3 = 'pob'
else:
downloaded_language_code3 = subtitle.language
downloaded_language = language_from_alpha3(downloaded_language_code3)
downloaded_language_code2 = alpha2_from_alpha3(downloaded_language_code3)
downloaded_path = subtitle.storage_path
logging.debug('BAZARR Subtitles file saved to disk: ' + downloaded_path)
if video.used_scene_name:
@ -368,9 +371,12 @@ def manual_download_subtitle(path, language, hi, subtitle, provider, providers_a
if saved_subtitles:
for saved_subtitle in saved_subtitles:
downloaded_provider = saved_subtitle.provider_name
downloaded_language = language_from_alpha3(saved_subtitle.language.alpha3)
downloaded_language_code2 = alpha2_from_alpha3(saved_subtitle.language.alpha3)
downloaded_language_code3 = saved_subtitle.language.alpha3
if saved_subtitle.language == 'pt-BR':
downloaded_language_code3 = 'pob'
else:
downloaded_language_code3 = subtitle.language
downloaded_language = language_from_alpha3(downloaded_language_code3)
downloaded_language_code2 = alpha2_from_alpha3(downloaded_language_code3)
downloaded_path = saved_subtitle.storage_path
logging.debug('BAZARR Subtitles file saved to disk: ' + downloaded_path)
message = downloaded_language + " subtitles downloaded from " + downloaded_provider + " with a score of " + unicode(

@ -467,6 +467,9 @@
hi = $(this).attr("data-hi");
sonarrSeriesId = $(this).attr("data-sonarrSeriesId");
sonarrEpisodeId = $(this).attr("data-sonarrEpisodeId");
var languages = Array.from({{!subs_languages_list}});
var is_pb = languages.includes('pb');
var is_pt = languages.includes('pt');
const values = {
episodePath: episodePath,
@ -505,7 +508,15 @@
return data +'%';
}
},
{ data: 'language' },
{ data: null,
render: function ( data, type, row ) {
if ( data.language === "pt" && is_pb === true && is_pt === false) {
return 'pb'
} else {
return data.language
}
}
},
{ data: 'hearing_impaired' },
{ data: null,
render: function ( data, type, row ) {

@ -416,6 +416,9 @@
language = $(this).attr("data-language");
hi = $(this).attr("data-hi");
radarrId = $(this).attr("data-radarrId");
var languages = Array.from({{!subs_languages_list}});
var is_pb = languages.includes('pb');
var is_pt = languages.includes('pt');
const values = {
moviePath: moviePath,
@ -453,7 +456,15 @@
return data +'%';
}
},
{ data: 'language' },
{ data: null,
render: function ( data, type, row ) {
if ( data.language === "pt" && is_pb === true && is_pt === false) {
return 'pb'
} else {
return data.language
}
}
},
{ data: 'hearing_impaired' },
{ data: null,
render: function ( data, type, row ) {

Loading…
Cancel
Save