From 52a530a991c7393239933812659b8b3e1e6d58fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Tue, 2 Apr 2019 06:25:04 -0400 Subject: [PATCH 1/3] Fix for #375 --- views/historymovies.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/historymovies.tpl b/views/historymovies.tpl index 13a69d0b1..346ae279d 100644 --- a/views/historymovies.tpl +++ b/views/historymovies.tpl @@ -87,7 +87,7 @@ % upgradable_criteria = (row[5], row[2], row[8]) % if upgradable_criteria in upgradable_movies: - % if row[7] and row[7] in ast.literal_eval(str(row[6])): + % if row[6] and row[7] and row[7] in ast.literal_eval(str(row[6])):
{{row[3]}}
From e7155609c7edea2bd579cecd0c94bf0572fbebf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Tue, 2 Apr 2019 22:22:51 -0400 Subject: [PATCH 2/3] Fix for embedded subtitles indexed even if use embedded subtitles is false. --- bazarr/list_subtitles.py | 82 ++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/bazarr/list_subtitles.py b/bazarr/list_subtitles.py index 9edadfa09..a70607069 100644 --- a/bazarr/list_subtitles.py +++ b/bazarr/list_subtitles.py @@ -31,26 +31,27 @@ def store_subtitles(file): actual_subtitles = [] if os.path.exists(file): notifications.write(msg='Analyzing this file for subtitles: ' + file, queue='list_subtitles') - if os.path.splitext(file)[1] == '.mkv': - logging.debug("BAZARR is trying to index embedded subtitles.") - try: - with open(file, 'rb') as f: - mkv = enzyme.MKV(f) - - for subtitle_track in mkv.subtitle_tracks: - try: - if alpha2_from_alpha3(subtitle_track.language) is not None: - lang = str(alpha2_from_alpha3(subtitle_track.language)) - logging.debug("BAZARR embedded subtitles detected: " + lang) - actual_subtitles.append([lang, None]) - except: - logging.debug("BAZARR unable to index this unrecognized language: " + subtitle_track.language) - pass - except Exception as e: - logging.exception("BAZARR error when trying to analyze this mkv file: " + file) - pass - else: - logging.debug("BAZARR This file isn't an .mkv file.") + if settings.general.getboolean('use_embedded_subs'): + if os.path.splitext(file)[1] == '.mkv': + logging.debug("BAZARR is trying to index embedded subtitles.") + try: + with open(file, 'rb') as f: + mkv = enzyme.MKV(f) + + for subtitle_track in mkv.subtitle_tracks: + try: + if alpha2_from_alpha3(subtitle_track.language) is not None: + lang = str(alpha2_from_alpha3(subtitle_track.language)) + logging.debug("BAZARR embedded subtitles detected: " + lang) + actual_subtitles.append([lang, None]) + except: + logging.debug("BAZARR unable to index this unrecognized language: " + subtitle_track.language) + pass + except Exception as e: + logging.exception("BAZARR error when trying to analyze this mkv file: " + file) + pass + else: + logging.debug("BAZARR This file isn't an .mkv file.") brazilian_portuguese = [".pt-br", ".pob", "pb"] try: @@ -116,26 +117,27 @@ def store_subtitles_movie(file): actual_subtitles = [] if os.path.exists(file): notifications.write(msg='Analyzing this file for subtitles: ' + file, queue='list_subtitles') - if os.path.splitext(file)[1] == '.mkv': - logging.debug("BAZARR is trying to index embedded subtitles.") - try: - with open(file, 'rb') as f: - mkv = enzyme.MKV(f) - - for subtitle_track in mkv.subtitle_tracks: - try: - if alpha2_from_alpha3(subtitle_track.language) is not None: - lang = str(alpha2_from_alpha3(subtitle_track.language)) - logging.debug("BAZARR embedded subtitles detected: " + lang) - actual_subtitles.append([lang, None]) - except: - logging.debug("BAZARR unable to index this unrecognized language: " + subtitle_track.language) - pass - except Exception as e: - logging.exception("BAZARR error when trying to analyze this mkv file: " + file) - pass - else: - logging.debug("BAZARR This file isn't an .mkv file.") + if settings.general.getboolean('use_embedded_subs'): + if os.path.splitext(file)[1] == '.mkv': + logging.debug("BAZARR is trying to index embedded subtitles.") + try: + with open(file, 'rb') as f: + mkv = enzyme.MKV(f) + + for subtitle_track in mkv.subtitle_tracks: + try: + if alpha2_from_alpha3(subtitle_track.language) is not None: + lang = str(alpha2_from_alpha3(subtitle_track.language)) + logging.debug("BAZARR embedded subtitles detected: " + lang) + actual_subtitles.append([lang, None]) + except: + logging.debug("BAZARR unable to index this unrecognized language: " + subtitle_track.language) + pass + except Exception as e: + logging.exception("BAZARR error when trying to analyze this mkv file: " + file) + pass + else: + logging.debug("BAZARR This file isn't an .mkv file.") dest_folder = get_subtitle_destination_folder() subliminal_patch.core.CUSTOM_PATHS = [dest_folder] if dest_folder else [] From 171fd6111687ba618282e9bff753e2ce64f3bc8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Tue, 2 Apr 2019 22:43:44 -0400 Subject: [PATCH 3/3] Fix for wizard not having the same options as settings for subfolder. --- views/wizard.tpl | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/views/wizard.tpl b/views/wizard.tpl index 51c1e975f..49a215431 100644 --- a/views/wizard.tpl +++ b/views/wizard.tpl @@ -347,11 +347,9 @@
@@ -364,7 +362,8 @@ -
+
+
@@ -379,8 +378,7 @@ @@ -1936,6 +1934,19 @@ $(function() { $('#loader').removeClass('active'); }); + if (($('#settings_subfolder').val() !== "relative") && ($('#settings_subfolder').val() !== "absolute")) { + $('.subfolder').hide(); + } + + $('#settings_subfolder').dropdown('setting', 'onChange', function(){ + if (($('#settings_subfolder').val() !== "relative") && ($('#settings_subfolder').val() !== "absolute")) { + $('.subfolder').hide(); + } + else { + $('.subfolder').show(); + } + }); + $('#sonarr_validate').on('click', function() { if ($('#sonarr_ssl_div').checkbox('is checked')) {