mirror of https://github.com/morpheus65535/bazarr
Merge remote-tracking branch 'origin/development' into development
This commit is contained in:
commit
2006f7be31
|
@ -31,7 +31,6 @@ defaults = {
|
|||
'page_size': '25',
|
||||
'minimum_score_movie': '70',
|
||||
'use_embedded_subs': 'True',
|
||||
'only_monitored': 'False',
|
||||
'adaptive_searching': 'False',
|
||||
'enabled_providers': ''
|
||||
},
|
||||
|
@ -46,7 +45,8 @@ defaults = {
|
|||
'base_url': '/',
|
||||
'ssl': 'False',
|
||||
'apikey': '',
|
||||
'full_update': 'Daily'
|
||||
'full_update': 'Daily',
|
||||
'only_monitored': 'False',
|
||||
},
|
||||
'radarr': {
|
||||
'ip': '127.0.0.1',
|
||||
|
@ -54,7 +54,8 @@ defaults = {
|
|||
'base_url': '/',
|
||||
'ssl': 'False',
|
||||
'apikey': '',
|
||||
'full_update': 'Daily'
|
||||
'full_update': 'Daily',
|
||||
'only_monitored': 'False',
|
||||
},
|
||||
'proxy': {
|
||||
'type': 'None',
|
||||
|
|
|
@ -351,7 +351,7 @@ def manual_download_subtitle(path, language, hi, subtitle, provider, providers_a
|
|||
|
||||
|
||||
def series_download_subtitles(no):
|
||||
if settings.general.getboolean('only_monitored'):
|
||||
if settings.sonarr.getboolean('only_monitored'):
|
||||
monitored_only_query_string = ' AND monitored = "True"'
|
||||
else:
|
||||
monitored_only_query_string = ""
|
||||
|
@ -485,7 +485,7 @@ def wanted_search_missing_subtitles():
|
|||
db.create_function("path_substitution_movie", 1, path_replace_movie)
|
||||
c = db.cursor()
|
||||
|
||||
if settings.general.getboolean('only_monitored'):
|
||||
if settings.sonarr.getboolean('only_monitored'):
|
||||
monitored_only_query_string = ' AND monitored = "True"'
|
||||
else:
|
||||
monitored_only_query_string = ""
|
||||
|
@ -510,7 +510,7 @@ def wanted_search_missing_subtitles():
|
|||
|
||||
|
||||
def search_active(timestamp):
|
||||
if settings.general.getboolean('only_monitored'):
|
||||
if settings.general.getboolean('adaptive_searching'):
|
||||
search_deadline = timedelta(weeks=3)
|
||||
search_delta = timedelta(weeks=1)
|
||||
aa = datetime.fromtimestamp(float(timestamp))
|
||||
|
|
|
@ -85,6 +85,14 @@ if cfg.has_section('general'):
|
|||
cfg.set('general', 'debug', 'False')
|
||||
with open(config_file, 'w+') as configfile:
|
||||
cfg.write(configfile)
|
||||
|
||||
if cfg.has_option('general', 'only_monitored'):
|
||||
only_monitored = cfg.get('general', 'only_monitored')
|
||||
cfg.set('sonarr', 'only_monitored', str(only_monitored))
|
||||
cfg.set('radarr', 'only_monitored', str(only_monitored))
|
||||
cfg.remove_option('general', 'only_monitored')
|
||||
with open(config_file, 'w+') as configfile:
|
||||
cfg.write(configfile)
|
||||
|
||||
# Move providers settings from DB to config file
|
||||
try:
|
||||
|
|
|
@ -266,11 +266,6 @@ def save_wizard():
|
|||
settings_general_single_language = 'False'
|
||||
else:
|
||||
settings_general_single_language = 'True'
|
||||
settings_general_adaptive_searching = request.forms.get('settings_general_adaptive_searching')
|
||||
if settings_general_adaptive_searching is None:
|
||||
settings_general_adaptive_searching = 'False'
|
||||
else:
|
||||
settings_general_adaptive_searching = 'True'
|
||||
settings_general_use_sonarr = request.forms.get('settings_general_use_sonarr')
|
||||
if settings_general_use_sonarr is None:
|
||||
settings_general_use_sonarr = 'False'
|
||||
|
@ -290,7 +285,6 @@ def save_wizard():
|
|||
settings.general.use_sonarr = text_type(settings_general_use_sonarr)
|
||||
settings.general.use_radarr = text_type(settings_general_use_radarr)
|
||||
settings.general.path_mappings_movie = text_type(settings_general_pathmapping_movie)
|
||||
settings.general.adaptive_searching = text_type(settings_general_adaptive_searching)
|
||||
|
||||
settings_sonarr_ip = request.forms.get('settings_sonarr_ip')
|
||||
settings_sonarr_port = request.forms.get('settings_sonarr_port')
|
||||
|
@ -301,12 +295,18 @@ def save_wizard():
|
|||
else:
|
||||
settings_sonarr_ssl = 'True'
|
||||
settings_sonarr_apikey = request.forms.get('settings_sonarr_apikey')
|
||||
settings_sonarr_only_monitored = request.forms.get('settings_sonarr_only_monitored')
|
||||
if settings_sonarr_only_monitored is None:
|
||||
settings_sonarr_only_monitored = 'False'
|
||||
else:
|
||||
settings_sonarr_only_monitored = 'True'
|
||||
|
||||
settings.sonarr.ip = text_type(settings_sonarr_ip)
|
||||
settings.sonarr.port = text_type(settings_sonarr_port)
|
||||
settings.sonarr.base_url = text_type(settings_sonarr_baseurl)
|
||||
settings.sonarr.ssl = text_type(settings_sonarr_ssl)
|
||||
settings.sonarr.apikey = text_type(settings_sonarr_apikey)
|
||||
settings.sonarr.only_monitored = text_type(settings_sonarr_only_monitored)
|
||||
|
||||
settings_radarr_ip = request.forms.get('settings_radarr_ip')
|
||||
settings_radarr_port = request.forms.get('settings_radarr_port')
|
||||
|
@ -317,16 +317,18 @@ def save_wizard():
|
|||
else:
|
||||
settings_radarr_ssl = 'True'
|
||||
settings_radarr_apikey = request.forms.get('settings_radarr_apikey')
|
||||
if settings_radarr_apikey != '':
|
||||
settings.general.use_radarr = 'True'
|
||||
settings_radarr_only_monitored = request.forms.get('settings_radarr_only_monitored')
|
||||
if settings_radarr_only_monitored is None:
|
||||
settings_radarr_only_monitored = 'False'
|
||||
else:
|
||||
settings.general.use_radarr = 'False'
|
||||
settings_radarr_only_monitored = 'True'
|
||||
|
||||
settings.radarr.ip = text_type(settings_radarr_ip)
|
||||
settings.radarr.port = text_type(settings_radarr_port)
|
||||
settings.radarr.base_url = text_type(settings_radarr_baseurl)
|
||||
settings.radarr.ssl = text_type(settings_radarr_ssl)
|
||||
settings.radarr.apikey = text_type(settings_radarr_apikey)
|
||||
settings.radarr.only_monitored = text_type(settings_radarr_only_monitored)
|
||||
|
||||
settings_subliminal_providers = request.forms.getall('settings_subliminal_providers')
|
||||
settings.general.enabled_providers = u'' if not settings_subliminal_providers else ','.join(settings_subliminal_providers)
|
||||
|
@ -477,7 +479,7 @@ def series():
|
|||
offset = (int(page) - 1) * page_size
|
||||
max_page = int(math.ceil(missing_count / (page_size + 0.0)))
|
||||
|
||||
if settings.general.getboolean('only_monitored'):
|
||||
if settings.sonarr.getboolean('only_monitored'):
|
||||
monitored_only_query_string = ' AND monitored = "True"'
|
||||
else:
|
||||
monitored_only_query_string = ""
|
||||
|
@ -927,7 +929,7 @@ def wantedseries():
|
|||
db.create_function("path_substitution", 1, path_replace)
|
||||
c = db.cursor()
|
||||
|
||||
if settings.general.getboolean('only_monitored'):
|
||||
if settings.sonarr.getboolean('only_monitored'):
|
||||
monitored_only_query_string = ' AND monitored = "True"'
|
||||
else:
|
||||
monitored_only_query_string = ""
|
||||
|
@ -956,7 +958,7 @@ def wantedmovies():
|
|||
db.create_function("path_substitution", 1, path_replace_movie)
|
||||
c = db.cursor()
|
||||
|
||||
if settings.general.getboolean('only_monitored'):
|
||||
if settings.radarr.getboolean('only_monitored'):
|
||||
monitored_only_query_string = ' AND monitored = "True"'
|
||||
else:
|
||||
monitored_only_query_string = ""
|
||||
|
@ -1053,11 +1055,6 @@ def save_settings():
|
|||
settings_general_embedded = 'False'
|
||||
else:
|
||||
settings_general_embedded = 'True'
|
||||
settings_general_only_monitored = request.forms.get('settings_general_only_monitored')
|
||||
if settings_general_only_monitored is None:
|
||||
settings_general_only_monitored = 'False'
|
||||
else:
|
||||
settings_general_only_monitored = 'True'
|
||||
settings_general_adaptive_searching = request.forms.get('settings_general_adaptive_searching')
|
||||
if settings_general_adaptive_searching is None:
|
||||
settings_general_adaptive_searching = 'False'
|
||||
|
@ -1104,7 +1101,6 @@ def save_settings():
|
|||
settings.general.page_size = text_type(settings_page_size)
|
||||
settings.general.minimum_score_movie = text_type(settings_general_minimum_score_movies)
|
||||
settings.general.use_embedded_subs = text_type(settings_general_embedded)
|
||||
settings.general.only_monitored = text_type(settings_general_only_monitored)
|
||||
settings.general.adaptive_searching = text_type(settings_general_adaptive_searching)
|
||||
|
||||
if after != before:
|
||||
|
@ -1180,6 +1176,11 @@ def save_settings():
|
|||
else:
|
||||
settings_sonarr_ssl = 'True'
|
||||
settings_sonarr_apikey = request.forms.get('settings_sonarr_apikey')
|
||||
settings_sonarr_only_monitored = request.forms.get('settings_sonarr_only_monitored')
|
||||
if settings_sonarr_only_monitored is None:
|
||||
settings_sonarr_only_monitored = 'False'
|
||||
else:
|
||||
settings_sonarr_only_monitored = 'True'
|
||||
settings_sonarr_sync = request.forms.get('settings_sonarr_sync')
|
||||
|
||||
settings.sonarr.ip = text_type(settings_sonarr_ip)
|
||||
|
@ -1187,6 +1188,7 @@ def save_settings():
|
|||
settings.sonarr.base_url = text_type(settings_sonarr_baseurl)
|
||||
settings.sonarr.ssl = text_type(settings_sonarr_ssl)
|
||||
settings.sonarr.apikey = text_type(settings_sonarr_apikey)
|
||||
settings.sonarr.only_monitored = text_type(settings_sonarr_only_monitored)
|
||||
settings.sonarr.full_update = text_type(settings_sonarr_sync)
|
||||
|
||||
settings_radarr_ip = request.forms.get('settings_radarr_ip')
|
||||
|
@ -1198,6 +1200,11 @@ def save_settings():
|
|||
else:
|
||||
settings_radarr_ssl = 'True'
|
||||
settings_radarr_apikey = request.forms.get('settings_radarr_apikey')
|
||||
settings_radarr_only_monitored = request.forms.get('settings_radarr_only_monitored')
|
||||
if settings_radarr_only_monitored is None:
|
||||
settings_radarr_only_monitored = 'False'
|
||||
else:
|
||||
settings_radarr_only_monitored = 'True'
|
||||
settings_radarr_sync = request.forms.get('settings_radarr_sync')
|
||||
|
||||
settings.radarr.ip = text_type(settings_radarr_ip)
|
||||
|
@ -1205,6 +1212,7 @@ def save_settings():
|
|||
settings.radarr.base_url = text_type(settings_radarr_baseurl)
|
||||
settings.radarr.ssl = text_type(settings_radarr_ssl)
|
||||
settings.radarr.apikey = text_type(settings_radarr_apikey)
|
||||
settings.radarr.only_monitored = text_type(settings_radarr_only_monitored)
|
||||
settings.radarr.full_update = text_type(settings_radarr_sync)
|
||||
|
||||
settings_subliminal_providers = request.forms.getall('settings_subliminal_providers')
|
||||
|
|
|
@ -28,16 +28,22 @@
|
|||
% import sqlite3
|
||||
% from config import settings
|
||||
|
||||
%if settings.general.getboolean('only_monitored'):
|
||||
% monitored_only_query_string = ' AND monitored = "True"'
|
||||
%if settings.sonarr.getboolean('only_monitored'):
|
||||
% monitored_only_query_string_sonarr = ' AND monitored = "True"'
|
||||
%else:
|
||||
% monitored_only_query_string = ""
|
||||
% monitored_only_query_string_sonarr = ""
|
||||
%end
|
||||
|
||||
%if settings.radarr.getboolean('only_monitored'):
|
||||
% monitored_only_query_string_radarr = ' AND monitored = "True"'
|
||||
%else:
|
||||
% monitored_only_query_string_radarr = ""
|
||||
%end
|
||||
|
||||
% conn = sqlite3.connect(os.path.join(config_dir, 'db', 'bazarr.db'), timeout=30)
|
||||
% c = conn.cursor()
|
||||
% wanted_series = c.execute("SELECT COUNT(*) FROM table_episodes WHERE missing_subtitles != '[]'" + monitored_only_query_string).fetchone()
|
||||
% wanted_movies = c.execute("SELECT COUNT(*) FROM table_movies WHERE missing_subtitles != '[]'" + monitored_only_query_string).fetchone()
|
||||
% wanted_series = c.execute("SELECT COUNT(*) FROM table_episodes WHERE missing_subtitles != '[]'" + monitored_only_query_string_sonarr).fetchone()
|
||||
% wanted_movies = c.execute("SELECT COUNT(*) FROM table_movies WHERE missing_subtitles != '[]'" + monitored_only_query_string_radarr).fetchone()
|
||||
|
||||
<div id="divmenu" class="ui container">
|
||||
<div class="ui grid">
|
||||
|
|
|
@ -780,6 +780,26 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Download only monitored</label>
|
||||
</div>
|
||||
<div class="one wide column">
|
||||
<div id="settings_only_monitored_sonarr" class="ui toggle checkbox" data-monitored={{settings.sonarr.getboolean('only_monitored')}}>
|
||||
<input name="settings_sonarr_only_monitored" type="checkbox">
|
||||
<label></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed column">
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Automatic download of subtitles will happen only for monitored episodes in Sonarr." data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -906,6 +926,26 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Download only monitored</label>
|
||||
</div>
|
||||
<div class="one wide column">
|
||||
<div id="settings_only_monitored_radarr" class="ui toggle checkbox" data-monitored={{settings.radarr.getboolean('only_monitored')}}>
|
||||
<input name="settings_radarr_only_monitored" type="checkbox">
|
||||
<label></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed column">
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Automatic download of subtitles will happen only for monitored movies in Radarr." data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1018,25 +1058,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Download only monitored</label>
|
||||
</div>
|
||||
<div class="one wide column">
|
||||
<div id="settings_only_monitored" class="ui toggle checkbox" data-monitored={{settings.general.getboolean('only_monitored')}}>
|
||||
<input name="settings_general_only_monitored" type="checkbox">
|
||||
<label></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed column">
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Automatic download of subtitles will happen only for monitored episodes/movies in Sonarr/Radarr." 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>Adaptive searching</label>
|
||||
|
@ -1561,10 +1582,16 @@
|
|||
$("#settings_embedded").checkbox('uncheck');
|
||||
}
|
||||
|
||||
if ($('#settings_only_monitored').data("monitored") === "True") {
|
||||
$("#settings_only_monitored").checkbox('check');
|
||||
if ($('#settings_only_monitored_sonarr').data("monitored") === "True") {
|
||||
$("#settings_only_monitored_sonarr").checkbox('check');
|
||||
} else {
|
||||
$("#settings_only_monitored").checkbox('uncheck');
|
||||
$("#settings_only_monitored_sonarr").checkbox('uncheck');
|
||||
}
|
||||
|
||||
if ($('#settings_only_monitored_radarr').data("monitored") === "True") {
|
||||
$("#settings_only_monitored_radarr").checkbox('check');
|
||||
} else {
|
||||
$("#settings_only_monitored_radarr").checkbox('uncheck');
|
||||
}
|
||||
|
||||
if ($('#settings_adaptive_searching').data("adaptive") === "True") {
|
||||
|
|
|
@ -38,16 +38,22 @@
|
|||
% import sqlite3
|
||||
% from config import settings
|
||||
|
||||
%if settings.general.getboolean('only_monitored'):
|
||||
% monitored_only_query_string = ' AND monitored = "True"'
|
||||
%if settings.sonarr.getboolean('only_monitored'):
|
||||
% monitored_only_query_string_sonarr = ' AND monitored = "True"'
|
||||
%else:
|
||||
% monitored_only_query_string = ""
|
||||
% monitored_only_query_string_sonarr = ""
|
||||
%end
|
||||
|
||||
%if settings.radarr.getboolean('only_monitored'):
|
||||
% monitored_only_query_string_radarr = ' AND monitored = "True"'
|
||||
%else:
|
||||
% monitored_only_query_string_radarr = ""
|
||||
%end
|
||||
|
||||
% conn = sqlite3.connect(os.path.join(config_dir, 'db', 'bazarr.db'), timeout=30)
|
||||
% c = conn.cursor()
|
||||
% wanted_series = c.execute("SELECT COUNT(*) FROM table_episodes WHERE missing_subtitles != '[]'" + monitored_only_query_string).fetchone()
|
||||
% wanted_movies = c.execute("SELECT COUNT(*) FROM table_movies WHERE missing_subtitles != '[]'" + monitored_only_query_string).fetchone()
|
||||
% wanted_series = c.execute("SELECT COUNT(*) FROM table_episodes WHERE missing_subtitles != '[]'" + monitored_only_query_string_sonarr).fetchone()
|
||||
% wanted_movies = c.execute("SELECT COUNT(*) FROM table_movies WHERE missing_subtitles != '[]'" + monitored_only_query_string_radarr).fetchone()
|
||||
% c.close()
|
||||
|
||||
<div id='loader' class="ui page dimmer">
|
||||
|
|
|
@ -824,6 +824,25 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sonarr_hide middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Download only monitored</label>
|
||||
</div>
|
||||
<div class="one wide column">
|
||||
<div id="settings_only_monitored_sonarr" class="ui toggle checkbox" data-monitored={{settings.sonarr.getboolean('only_monitored')}}>
|
||||
<input name="settings_sonarr_only_monitored" type="checkbox">
|
||||
<label></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed column">
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Automatic download of subtitles will happen only for monitored episodes in Sonarr." data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -956,6 +975,25 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="radarr_hide middle aligned row">
|
||||
<div class="right aligned four wide column">
|
||||
<label>Download only monitored</label>
|
||||
</div>
|
||||
<div class="one wide column">
|
||||
<div id="settings_only_monitored_radarr" class="ui toggle checkbox" data-monitored={{settings.radarr.getboolean('only_monitored')}}>
|
||||
<input name="settings_radarr_only_monitored" type="checkbox">
|
||||
<label></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsed column">
|
||||
<div class="collapsed center aligned column">
|
||||
<div class="ui basic icon" data-tooltip="Automatic download of subtitles will happen only for monitored movies in Radarr." data-inverted="">
|
||||
<i class="help circle large icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1170,6 +1208,18 @@ $(function() {
|
|||
$("#settings_movie_default_hi_div").addClass('disabled');
|
||||
}
|
||||
|
||||
if ($('#settings_only_monitored_sonarr').data("monitored") === "True") {
|
||||
$("#settings_only_monitored_sonarr").checkbox('check');
|
||||
} else {
|
||||
$("#settings_only_monitored_sonarr").checkbox('uncheck');
|
||||
}
|
||||
|
||||
if ($('#settings_only_monitored_radarr').data("monitored") === "True") {
|
||||
$("#settings_only_monitored_radarr").checkbox('check');
|
||||
} else {
|
||||
$("#settings_only_monitored_radarr").checkbox('uncheck');
|
||||
}
|
||||
|
||||
$('#settings_movie_default_enabled_div').checkbox({
|
||||
onChecked: function() {
|
||||
$("#settings_movie_default_languages").parent().removeClass('disabled');
|
||||
|
|
Loading…
Reference in New Issue