aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLouis Vézina <[email protected]>2018-08-03 07:21:46 -0400
committerLouis Vézina <[email protected]>2018-08-03 07:21:46 -0400
commit9857368c958ca31a5250e9e6fc98e69888337a8a (patch)
tree27b29bb731415489de4433204091f4d262290a03
parent55be0aad60b4e3970fd84975e2dcbba6bb00da29 (diff)
downloadbazarr-9857368c958ca31a5250e9e6fc98e69888337a8a.tar.gz
bazarr-9857368c958ca31a5250e9e6fc98e69888337a8a.zip
Added dedicated minimum score settings for movie and episode #95
-rw-r--r--bazarr.py3
-rw-r--r--get_general_settings.py6
-rw-r--r--get_subtitle.py3
-rw-r--r--update_db.py7
-rw-r--r--views/settings.tpl24
5 files changed, 37 insertions, 6 deletions
diff --git a/bazarr.py b/bazarr.py
index 63572993c..a75038752 100644
--- a/bazarr.py
+++ b/bazarr.py
@@ -758,6 +758,7 @@ def save_settings():
else:
settings_general_embedded = 'True'
settings_general_minimum_score = request.forms.get('settings_general_minimum_score')
+ settings_general_minimum_score_movies = request.forms.get('settings_general_minimum_score_movies')
settings_general_use_postprocessing = request.forms.get('settings_general_use_postprocessing')
if settings_general_use_postprocessing is None:
settings_general_use_postprocessing = 'False'
@@ -778,7 +779,7 @@ def save_settings():
before = c.execute("SELECT ip, port, base_url, log_level, path_mapping, use_sonarr, use_radarr, path_mapping_movie FROM table_settings_general").fetchone()
after = (unicode(settings_general_ip), int(settings_general_port), unicode(settings_general_baseurl), unicode(settings_general_loglevel), unicode(settings_general_pathmapping), unicode(settings_general_use_sonarr), unicode(settings_general_use_radarr), unicode(settings_general_pathmapping_movie))
- c.execute("UPDATE table_settings_general SET ip = ?, port = ?, base_url = ?, path_mapping = ?, log_level = ?, branch=?, auto_update=?, single_language=?, minimum_score=?, use_scenename=?, use_postprocessing=?, postprocessing_cmd=?, use_sonarr=?, use_radarr=?, path_mapping_movie=?, page_size=?, use_embedded_subs=?", (unicode(settings_general_ip), int(settings_general_port), unicode(settings_general_baseurl), unicode(settings_general_pathmapping), unicode(settings_general_loglevel), unicode(settings_general_branch), unicode(settings_general_automatic), unicode(settings_general_single_language), unicode(settings_general_minimum_score), unicode(settings_general_scenename), unicode(settings_general_use_postprocessing), unicode(settings_general_postprocessing_cmd), unicode(settings_general_use_sonarr), unicode(settings_general_use_radarr), unicode(settings_general_pathmapping_movie), unicode(settings_page_size), unicode(settings_general_embedded)))
+ c.execute("UPDATE table_settings_general SET ip = ?, port = ?, base_url = ?, path_mapping = ?, log_level = ?, branch=?, auto_update=?, single_language=?, minimum_score=?, use_scenename=?, use_postprocessing=?, postprocessing_cmd=?, use_sonarr=?, use_radarr=?, path_mapping_movie=?, page_size=?, use_embedded_subs=?, minimum_score_movie=?", (unicode(settings_general_ip), int(settings_general_port), unicode(settings_general_baseurl), unicode(settings_general_pathmapping), unicode(settings_general_loglevel), unicode(settings_general_branch), unicode(settings_general_automatic), unicode(settings_general_single_language), unicode(settings_general_minimum_score), unicode(settings_general_scenename), unicode(settings_general_use_postprocessing), unicode(settings_general_postprocessing_cmd), unicode(settings_general_use_sonarr), unicode(settings_general_use_radarr), unicode(settings_general_pathmapping_movie), unicode(settings_page_size), unicode(settings_general_embedded), unicode(settings_general_minimum_score_movies)))
conn.commit()
if after != before:
configured()
diff --git a/get_general_settings.py b/get_general_settings.py
index 9254f0d5a..3794c6d6f 100644
--- a/get_general_settings.py
+++ b/get_general_settings.py
@@ -51,8 +51,9 @@ def get_general_settings():
movie_default_hi = general_settings[22]
page_size = general_settings[23]
use_embedded_subs = general_settings[24]
+ minimum_score_movie = general_settings[25]
- return [ip, port, base_url, path_mappings, log_level, branch, automatic, single_language, minimum_score, use_scenename, use_postprocessing, postprocessing_cmd, use_sonarr, use_radarr, path_mappings_movie, serie_default_enabled, serie_default_language, serie_default_hi, movie_default_enabled,movie_default_language, movie_default_hi, page_size, use_embedded_subs]
+ return [ip, port, base_url, path_mappings, log_level, branch, automatic, single_language, minimum_score, use_scenename, use_postprocessing, postprocessing_cmd, use_sonarr, use_radarr, path_mappings_movie, serie_default_enabled, serie_default_language, serie_default_hi, movie_default_enabled,movie_default_language, movie_default_hi, page_size, use_embedded_subs, minimum_score_movie]
def path_replace(path):
for path_mapping in path_mappings:
@@ -131,4 +132,5 @@ movie_default_enabled = result[18]
movie_default_language = result[19]
movie_default_hi = result[20]
page_size = result[21]
-use_embedded_subs = result[22] \ No newline at end of file
+use_embedded_subs = result[22]
+minimum_score_movie = result[23] \ No newline at end of file
diff --git a/get_subtitle.py b/get_subtitle.py
index 6af3d98d1..6bca5a1af 100644
--- a/get_subtitle.py
+++ b/get_subtitle.py
@@ -18,9 +18,10 @@ region.configure('dogpile.cache.memory')
def download_subtitle(path, language, hi, providers, providers_auth, sceneName, type):
if type == 'series':
type_of_score = 359
+ minimum_score = float(get_general_settings()[8]) / 100 * type_of_score
elif type == 'movies':
type_of_score = 119
- minimum_score = float(get_general_settings()[8]) / 100 * type_of_score
+ minimum_score = float(get_general_settings()[23]) / 100 * type_of_score
use_scenename = get_general_settings()[9]
use_postprocessing = get_general_settings()[10]
postprocessing_cmd = get_general_settings()[11]
diff --git a/update_db.py b/update_db.py
index 339f50034..0608a35c6 100644
--- a/update_db.py
+++ b/update_db.py
@@ -57,6 +57,13 @@ if os.path.exists(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'))
c.execute('UPDATE table_settings_general SET minimum_score="0"')
try:
+ c.execute('alter table table_settings_general add column "minimum_score_movie" "text"')
+ except:
+ pass
+ else:
+ c.execute('UPDATE table_settings_general SET minimum_score_movie="0"')
+
+ try:
c.execute('alter table table_settings_general add column "use_scenename" "text"')
except:
pass
diff --git a/views/settings.tpl b/views/settings.tpl
index f659502c6..e9d706e07 100644
--- a/views/settings.tpl
+++ b/views/settings.tpl
@@ -812,7 +812,7 @@
<div class="middle aligned row">
<div class="right aligned four wide column">
- <label>Minimum score</label>
+ <label>Minimum score for episodes</label>
</div>
<div class="two wide column">
<div class='field'>
@@ -823,7 +823,27 @@
</div>
<div class="collapsed column">
<div class="collapsed center aligned column">
- <div class="ui basic icon" data-tooltip="Minimum score for a subtitle to be downloaded (0 to 100)." data-inverted="">
+ <div class="ui basic icon" data-tooltip="Minimum score for an episode subtitle to be downloaded (0 to 100)." data-inverted="">
+ <i class="help circle large icon"></i>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="middle aligned row">
+ <div class="right aligned four wide column">
+ <label>Minimum score for movies</label>
+ </div>
+ <div class="two wide column">
+ <div class='field'>
+ <div class="ui input">
+ <input name="settings_general_minimum_score_movies" type="number" min="0" max="100" step="5" onkeydown="return false" value="{{settings_general[25]}}">
+ </div>
+ </div>
+ </div>
+ <div class="collapsed column">
+ <div class="collapsed center aligned column">
+ <div class="ui basic icon" data-tooltip="Minimum score for a movie subtitle to be downloaded (0 to 100)." data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>