From 6f54777c9b623eded6cdcf7948916836d6ccc5bb Mon Sep 17 00:00:00 2001 From: Halali Date: Sat, 28 Sep 2019 19:52:47 +0200 Subject: [PATCH 1/5] Fix for rare issue with transparency --- views/menu.tpl | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/views/menu.tpl b/views/menu.tpl index 3d843a4d7..d55ac5943 100644 --- a/views/menu.tpl +++ b/views/menu.tpl @@ -261,19 +261,15 @@ ; if (window.location.href.indexOf("episodes") > -1) { - $('.menu_segment').css('background', '#000000'); - $('.menu_segment').css('opacity', '0.9'); + $('.menu_segment').css('background', 'rgba(0, 0, 0, 0.8)'); $('.menu_segment').css('border-color', '#000000'); - $('#divmenu').css('background', '#000000'); - $('#divmenu').css('opacity', '0.8'); + $('#divmenu').css('background', 'rgba(0, 0, 0, 0.8)'); $('#divmenu').css('box-shadow', '0 0 5px 5px #000000'); } else if (window.location.href.indexOf("movie/") > -1) { - $('.menu_segment').css('background', '#000000'); - $('.menu_segment').css('opacity', '0.9'); + $('.menu_segment').css('background', 'rgba(0, 0, 0, 0.9)'); $('.menu_segment').css('border-color', '#000000'); - $('#divmenu').css('background', '#000000'); - $('#divmenu').css('opacity', '0.8'); + $('#divmenu').css('background', 'rgba(0, 0, 0, 0.8)'); $('#divmenu').css('box-shadow', '0 0 5px 5px #000000'); } else { From 4a217fa90eb419d01e2d76599c62bb19a9483421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Sun, 29 Sep 2019 22:03:36 -0400 Subject: [PATCH 2/5] Added logging in case Bazarr cannot get Sonarr or Radarr version #596 --- bazarr/utils.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/bazarr/utils.py b/bazarr/utils.py index c3dde6c56..e431d996e 100644 --- a/bazarr/utils.py +++ b/bazarr/utils.py @@ -100,12 +100,11 @@ def get_sonarr_version(): use_sonarr = settings.general.getboolean('use_sonarr') apikey_sonarr = settings.sonarr.apikey sv = url_sonarr + "/api/system/status?apikey=" + apikey_sonarr - sonarr_version = '' if use_sonarr: try: - sonarr_version = requests.get(sv, timeout=15, verify=False).json()['version'] - except: - sonarr_version = '' + sonarr_version = requests.get(sv, timeout=30, verify=False).json()['version'] + except Exception as e: + logging.DEBUG('BAZARR cannot get Sonarr version') return sonarr_version @@ -114,11 +113,10 @@ def get_radarr_version(): use_radarr = settings.general.getboolean('use_radarr') apikey_radarr = settings.radarr.apikey rv = url_radarr + "/api/system/status?apikey=" + apikey_radarr - radarr_version = '' if use_radarr: try: - radarr_version = requests.get(rv, timeout=15, verify=False).json()['version'] - except: - radarr_version = '' + radarr_version = requests.get(rv, timeout=30, verify=False).json()['version'] + except Exception as e: + logging.DEBUG('BAZARR cannot get Radarr version') return radarr_version From 0bb2c2dd879e23739eea8bee833a20732ce2362d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Mon, 30 Sep 2019 23:29:08 -0400 Subject: [PATCH 3/5] Improvement to the manual search modal to show file path, scenename and subtitles matching releases. --- bazarr/get_subtitle.py | 3 ++- views/episodes.tpl | 24 +++++++++++++++++++++--- views/movie.tpl | 24 +++++++++++++++++++++--- 3 files changed, 44 insertions(+), 7 deletions(-) diff --git a/bazarr/get_subtitle.py b/bazarr/get_subtitle.py index 3b3859370..eb851a592 100644 --- a/bazarr/get_subtitle.py +++ b/bazarr/get_subtitle.py @@ -371,7 +371,8 @@ def manual_search(path, language, hi, forced, providers, providers_auth, sceneNa language=str(s.language), hearing_impaired=str(s.hearing_impaired), provider=s.provider_name, subtitle=codecs.encode(pickle.dumps(s.make_picklable()), "base64").decode(), - url=s.page_link, matches=list(matches), dont_matches=list(not_matched))) + url=s.page_link, matches=list(matches), dont_matches=list(not_matched), + release_info=s.release_info.split(',') if hasattr(s, 'release_info') else 'n/a')) final_subtitles = sorted(subtitles_list, key=lambda x: x['score'], reverse=True) logging.debug('BAZARR ' + str(len(final_subtitles)) + " Subtitles have been found for this file: " + path) diff --git a/views/episodes.tpl b/views/episodes.tpl index 5b07673de..48f699f57 100644 --- a/views/episodes.tpl +++ b/views/episodes.tpl @@ -383,16 +383,19 @@
- x - +
+
- - + + - + + @@ -566,6 +569,8 @@ $("#season").html($(this).data("season")); $("#episode").html($(this).data("episode")); $("#episode_title").html($(this).data("episode_title")); + $("#episode_path_span").html($(this).attr("data-episodePath")); + $("#episode_scenename_span").html($(this).attr("data-sceneName")); episodePath = $(this).attr("data-episodePath"); sceneName = $(this).attr("data-sceneName"); @@ -609,6 +614,7 @@ }, drawCallback: function(settings) { $('.inline.dropdown').dropdown(); + $('.ui.accordion').accordion(); }, columns: [ { data: 'score', @@ -655,6 +661,18 @@ }, { data: null, render: function ( data, type, row ) { + const array_release_info = data.release_info; + let i; + let text = '
...
'; + for (i = 0; i < array_release_info.length; i++) { + text += '
' + array_release_info[i] + '
'; + } + text += '
'; + return text; + } + }, + { data: null, + render: function ( data, type, row ) { return ''; } } diff --git a/views/movie.tpl b/views/movie.tpl index 2c0c6eb00..68b59e054 100644 --- a/views/movie.tpl +++ b/views/movie.tpl @@ -335,16 +335,19 @@
+
+
Score:Language:Hearing-Impaired:Lang.:HI: Provider:Based On:Matching:Filename:
- - + + - + + @@ -513,6 +516,8 @@ $('.manual_search').on('click', function(){ $("#movie_title_span").html($(this).data("movie_title")); + $("#movie_path_span").html($(this).attr("data-moviePath")); + $("#movie_scenename_span").html($(this).attr("data-sceneName")); moviePath = $(this).attr("data-moviePath"); sceneName = $(this).attr("data-sceneName"); @@ -554,6 +559,7 @@ }, drawCallback: function(settings) { $('.inline.dropdown').dropdown(); + $('.ui.accordion').accordion(); }, columns: [ { data: 'score', @@ -602,6 +608,18 @@ }, { data: null, render: function ( data, type, row ) { + const array_release_info = data.release_info; + let i; + let text = '
...
'; + for (i = 0; i < array_release_info.length; i++) { + text += '
' + array_release_info[i] + '
'; + } + text += '
'; + return text; + } + }, + { data: null, + render: function ( data, type, row ) { return ''; } } From 8a50f696c793801cfcbc22889d5b34232ad3ec1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Tue, 1 Oct 2019 06:42:05 -0400 Subject: [PATCH 4/5] Fix for manual search when releases_info is None. --- bazarr/get_subtitle.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bazarr/get_subtitle.py b/bazarr/get_subtitle.py index eb851a592..cd1a323d3 100644 --- a/bazarr/get_subtitle.py +++ b/bazarr/get_subtitle.py @@ -365,14 +365,19 @@ def manual_search(path, language, hi, forced, providers, providers_auth, sceneNa score = compute_score(matches, s, video, hearing_impaired=initial_hi) not_matched = scores - matches s.score = score - + + releases = ['n/a'] + if hasattr(s, 'release_info'): + if s.release_info is not None: + releases = s.release_info.split(',') + subtitles_list.append( dict(score=round((score / max_score * 100), 2), language=str(s.language), hearing_impaired=str(s.hearing_impaired), provider=s.provider_name, subtitle=codecs.encode(pickle.dumps(s.make_picklable()), "base64").decode(), url=s.page_link, matches=list(matches), dont_matches=list(not_matched), - release_info=s.release_info.split(',') if hasattr(s, 'release_info') else 'n/a')) + release_info=releases)) final_subtitles = sorted(subtitles_list, key=lambda x: x['score'], reverse=True) logging.debug('BAZARR ' + str(len(final_subtitles)) + " Subtitles have been found for this file: " + path) From e6feaa0863e2e9a6f7603a684376b2877fd231ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Tue, 1 Oct 2019 14:56:53 -0400 Subject: [PATCH 5/5] Fixed UI for long subtitles path. Now use tooltip for full path and show only filename. --- views/movie.tpl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/views/movie.tpl b/views/movie.tpl index 68b59e054..418b3fa1b 100644 --- a/views/movie.tpl +++ b/views/movie.tpl @@ -79,6 +79,7 @@ %import ast + %from os import path %from get_languages import * %from config import settings %from helper import path_replace_movie @@ -180,7 +181,11 @@ end %> - + %if subtitles_file[1] is not None: + + %else: + + %end
Score:Language:Hearing-Impaired:Lang.:HI: Provider:Based On:Matching:Subtitles filename:
{{path_replace_movie(subtitles_file[1]) if subtitles_file[1] is not None else 'Video File Subtitles Track'}}{{path.basename(path_replace_movie(subtitles_file[1]))}}Video File Subtitles Track
{{language_from_alpha2(subtitles_file[0].split(':')[0])}}{{' forced' if forced else ''}}
%if subtitles_file[1] is not None: