pull/997/head
Louis Vézina 5 years ago
parent 60723d8fd1
commit a3cecd6687

@ -204,235 +204,6 @@ def doRestart():
os._exit(0)
@app.route('/wizard/')
@login_required
def wizard():
# Get languages list
settings_languages = database.execute("SELECT * FROM table_settings_languages ORDER BY name")
# Get providers list
settings_providers = sorted(provider_manager.names())
return render_template('wizard.html', bazarr_version=bazarr_version, settings=settings,
settings_languages=settings_languages, settings_providers=settings_providers,
base_url=base_url, ast=ast)
@app.route('/save_wizard', methods=['POST'])
@login_required
def save_wizard():
settings_general_ip = request.form.get('settings_general_ip')
settings_general_port = request.form.get('settings_general_port')
settings_general_baseurl = request.form.get('settings_general_baseurl')
if not settings_general_baseurl.endswith('/'):
settings_general_baseurl += '/'
settings_general_sourcepath = request.form.getlist('settings_general_sourcepath[]')
settings_general_destpath = request.form.getlist('settings_general_destpath[]')
settings_general_pathmapping = []
settings_general_pathmapping.extend([list(a) for a in zip(settings_general_sourcepath, settings_general_destpath)])
settings_general_sourcepath_movie = request.form.getlist('settings_general_sourcepath_movie[]')
settings_general_destpath_movie = request.form.getlist('settings_general_destpath_movie[]')
settings_general_pathmapping_movie = []
settings_general_pathmapping_movie.extend(
[list(a) for a in zip(settings_general_sourcepath_movie, settings_general_destpath_movie)])
settings_general_single_language = request.form.get('settings_general_single_language')
if settings_general_single_language is None:
settings_general_single_language = 'False'
else:
settings_general_single_language = 'True'
settings_general_use_sonarr = request.form.get('settings_general_use_sonarr')
if settings_general_use_sonarr is None:
settings_general_use_sonarr = 'False'
else:
settings_general_use_sonarr = 'True'
settings_general_use_radarr = request.form.get('settings_general_use_radarr')
if settings_general_use_radarr is None:
settings_general_use_radarr = 'False'
else:
settings_general_use_radarr = 'True'
settings_general_embedded = request.form.get('settings_general_embedded')
if settings_general_embedded is None:
settings_general_embedded = 'False'
else:
settings_general_embedded = 'True'
settings_subfolder = request.form.get('settings_subfolder')
settings_subfolder_custom = request.form.get('settings_subfolder_custom')
settings_upgrade_subs = request.form.get('settings_upgrade_subs')
if settings_upgrade_subs is None:
settings_upgrade_subs = 'False'
else:
settings_upgrade_subs = 'True'
settings_days_to_upgrade_subs = request.form.get('settings_days_to_upgrade_subs')
settings_upgrade_manual = request.form.get('settings_upgrade_manual')
if settings_upgrade_manual is None:
settings_upgrade_manual = 'False'
else:
settings_upgrade_manual = 'True'
settings.general.ip = str(settings_general_ip)
settings.general.port = str(settings_general_port)
settings.general.base_url = str(settings_general_baseurl)
settings.general.path_mappings = str(settings_general_pathmapping)
settings.general.single_language = str(settings_general_single_language)
settings.general.use_sonarr = str(settings_general_use_sonarr)
settings.general.use_radarr = str(settings_general_use_radarr)
settings.general.path_mappings_movie = str(settings_general_pathmapping_movie)
settings.general.subfolder = str(settings_subfolder)
settings.general.subfolder_custom = str(settings_subfolder_custom)
settings.general.use_embedded_subs = str(settings_general_embedded)
settings.general.upgrade_subs = str(settings_upgrade_subs)
settings.general.days_to_upgrade_subs = str(settings_days_to_upgrade_subs)
settings.general.upgrade_manual = str(settings_upgrade_manual)
settings_sonarr_ip = request.form.get('settings_sonarr_ip')
settings_sonarr_port = request.form.get('settings_sonarr_port')
settings_sonarr_baseurl = request.form.get('settings_sonarr_baseurl')
settings_sonarr_ssl = request.form.get('settings_sonarr_ssl')
if settings_sonarr_ssl is None:
settings_sonarr_ssl = 'False'
else:
settings_sonarr_ssl = 'True'
settings_sonarr_apikey = request.form.get('settings_sonarr_apikey')
settings_sonarr_only_monitored = request.form.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 = str(settings_sonarr_ip)
settings.sonarr.port = str(settings_sonarr_port)
settings.sonarr.base_url = str(settings_sonarr_baseurl)
settings.sonarr.ssl = str(settings_sonarr_ssl)
settings.sonarr.apikey = str(settings_sonarr_apikey)
settings.sonarr.only_monitored = str(settings_sonarr_only_monitored)
settings_radarr_ip = request.form.get('settings_radarr_ip')
settings_radarr_port = request.form.get('settings_radarr_port')
settings_radarr_baseurl = request.form.get('settings_radarr_baseurl')
settings_radarr_ssl = request.form.get('settings_radarr_ssl')
if settings_radarr_ssl is None:
settings_radarr_ssl = 'False'
else:
settings_radarr_ssl = 'True'
settings_radarr_apikey = request.form.get('settings_radarr_apikey')
settings_radarr_only_monitored = request.form.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.ip = str(settings_radarr_ip)
settings.radarr.port = str(settings_radarr_port)
settings.radarr.base_url = str(settings_radarr_baseurl)
settings.radarr.ssl = str(settings_radarr_ssl)
settings.radarr.apikey = str(settings_radarr_apikey)
settings.radarr.only_monitored = str(settings_radarr_only_monitored)
settings_subliminal_providers = request.form.getlist('settings_subliminal_providers')
settings.general.enabled_providers = u'' if not settings_subliminal_providers else ','.join(
settings_subliminal_providers)
settings_addic7ed_random_agents = request.form.get('settings_addic7ed_random_agents')
if settings_addic7ed_random_agents is None:
settings_addic7ed_random_agents = 'False'
else:
settings_addic7ed_random_agents = 'True'
settings_opensubtitles_vip = request.form.get('settings_opensubtitles_vip')
if settings_opensubtitles_vip is None:
settings_opensubtitles_vip = 'False'
else:
settings_opensubtitles_vip = 'True'
settings_opensubtitles_ssl = request.form.get('settings_opensubtitles_ssl')
if settings_opensubtitles_ssl is None:
settings_opensubtitles_ssl = 'False'
else:
settings_opensubtitles_ssl = 'True'
settings_opensubtitles_skip_wrong_fps = request.form.get('settings_opensubtitles_skip_wrong_fps')
if settings_opensubtitles_skip_wrong_fps is None:
settings_opensubtitles_skip_wrong_fps = 'False'
else:
settings_opensubtitles_skip_wrong_fps = 'True'
settings.addic7ed.username = request.form.get('settings_addic7ed_username') or ''
settings.addic7ed.password = request.form.get('settings_addic7ed_password') or ''
settings.addic7ed.random_agents = str(settings_addic7ed_random_agents) or ''
settings.assrt.token = request.form.get('settings_assrt_token') or ''
settings.legendasdivx.username = request.form.get('settings_legendasdivx_username') or ''
settings.legendasdivx.password = request.form.get('settings_legendasdivx_password') or ''
settings.legendastv.username = request.form.get('settings_legendastv_username') or ''
settings.legendastv.password = request.form.get('settings_legendastv_password') or ''
settings.opensubtitles.username = request.form.get('settings_opensubtitles_username') or ''
settings.opensubtitles.password = request.form.get('settings_opensubtitles_password') or ''
settings.opensubtitles.vip = str(settings_opensubtitles_vip)
settings.opensubtitles.ssl = str(settings_opensubtitles_ssl)
settings.opensubtitles.skip_wrong_fps = str(settings_opensubtitles_skip_wrong_fps)
settings.xsubs.username = request.form.get('settings_xsubs_username') or ''
settings.xsubs.password = request.form.get('settings_xsubs_password') or ''
settings.napisy24.username = request.form.get('settings_napisy24_username') or ''
settings.napisy24.password = request.form.get('settings_napisy24_password') or ''
settings.subscene.username = request.form.get('settings_subscene_username') or ''
settings.subscene.password = request.form.get('settings_subscene_password') or ''
settings.titlovi.username = request.form.get('settings_titlovi_username') or ''
settings.titlovi.password = request.form.get('settings_titlovi_password') or ''
settings.betaseries.token = request.form.get('settings_betaseries_token') or ''
settings_subliminal_languages = request.form.getlist('settings_subliminal_languages')
# Disable all languages in DB
database.execute("UPDATE table_settings_languages SET enabled=0")
for item in settings_subliminal_languages:
# Enable each desired language in DB
database.execute("UPDATE table_settings_languages SET enabled=1 WHERE code2=?", (item,))
settings_serie_default_enabled = request.form.get('settings_serie_default_enabled')
if settings_serie_default_enabled is None:
settings_serie_default_enabled = 'False'
else:
settings_serie_default_enabled = 'True'
settings.general.serie_default_enabled = str(settings_serie_default_enabled)
settings_serie_default_languages = str(request.form.getlist('settings_serie_default_languages'))
if settings_serie_default_languages == "['None']":
settings_serie_default_languages = 'None'
settings.general.serie_default_language = str(settings_serie_default_languages)
settings_serie_default_hi = request.form.get('settings_serie_default_hi')
if settings_serie_default_hi is None:
settings_serie_default_hi = 'False'
else:
settings_serie_default_hi = 'True'
settings.general.serie_default_hi = str(settings_serie_default_hi)
settings_movie_default_enabled = request.form.get('settings_movie_default_enabled')
if settings_movie_default_enabled is None:
settings_movie_default_enabled = 'False'
else:
settings_movie_default_enabled = 'True'
settings.general.movie_default_enabled = str(settings_movie_default_enabled)
settings_movie_default_languages = str(request.form.getlist('settings_movie_default_languages'))
if settings_movie_default_languages == "['None']":
settings_movie_default_languages = 'None'
settings.general.movie_default_language = str(settings_movie_default_languages)
settings_movie_default_hi = request.form.get('settings_movie_default_hi')
if settings_movie_default_hi is None:
settings_movie_default_hi = 'False'
else:
settings_movie_default_hi = 'True'
settings.general.movie_default_hi = str(settings_movie_default_hi)
settings_movie_default_forced = str(request.form.get('settings_movie_default_forced'))
settings.general.movie_default_forced = str(settings_movie_default_forced)
with open(os.path.join(args.config_dir, 'config', 'config.ini'), 'w+') as handle:
settings.write(handle)
configured()
return redirect(base_url)
@app.route('/emptylog')
@login_required
def emptylog():
@ -484,10 +255,8 @@ def redirect_root():
return redirect(url_for('series'))
elif settings.general.getboolean('use_radarr'):
return redirect(url_for('movies'))
elif not settings.general.enabled_providers:
return redirect('/wizard')
else:
return redirect('/settings')
return redirect(url_for('settingsgeneral'))
@app.route('/series/')
@ -568,6 +337,12 @@ def settingsradarr():
return render_template('settingsradarr.html')
@app.route('/settings/subtitles/')
@login_required
def settingssubtitles():
return render_template('settingssubtitles.html')
@app.route('/check_update')
@login_required
def check_update():
@ -675,7 +450,7 @@ def api_movies_history():
@app.route('/test_url/<protocol>/<path:url>', methods=['GET'])
@login_required
def test_url(protocol, url):
url = unquote(url)
url = protocol + '://' + unquote(url)
try:
result = requests.get(url, allow_redirects=False, verify=False).json()['version']
except Exception as e:

@ -203,7 +203,7 @@
<li><a href="{{ url_for('settingsgeneral') }}"> General</a></li>
<li><a href="{{ url_for('settingssonarr') }}"> Sonarr</a></li>
<li><a href="{{ url_for('settingsradarr') }}"> Radarr</a></li>
<li><a href="/"> Subtitles</a></li>
<li><a href="{{ url_for('settingssubtitles') }}"> Subtitles</a></li>
<li><a href="/"> Languages</a></li>
<li><a href="/"> Providers</a></li>
<li><a href="/"> Notifications</a></li>

@ -34,7 +34,7 @@
<h4>Host</h4>
<hr/>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Bind Address</b>
</div>
<div class="col-sm-4">
@ -45,7 +45,7 @@
</div>
<br>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Port Number</b>
</div>
<div class="col-sm-4">
@ -55,7 +55,7 @@
</div>
<br>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>URL Base</b>
</div>
<div class="col-sm-4">
@ -69,7 +69,7 @@
<h4>Security</h4>
<hr/>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Authentication</b>
</div>
<div class="form-group col-sm-4">
@ -84,7 +84,7 @@
</div>
<div id="authentication_div">
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Username</b>
</div>
<div class="col-sm-4">
@ -93,7 +93,7 @@
</div>
<br>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Password</b>
</div>
<div class="col-sm-4">
@ -103,7 +103,7 @@
<br>
</div>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>API Key</b>
</div>
<div class="input-group col-sm-4">
@ -118,7 +118,7 @@
<h4>Proxy</h4>
<hr/>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Type</b>
</div>
<div class="form-group col-sm-4">
@ -133,7 +133,7 @@
</div>
<div id="proxy_div">
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Hostname</b>
</div>
<div class="col-sm-4">
@ -142,7 +142,7 @@
</div>
<br>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Port</b>
</div>
<div class="col-sm-4">
@ -151,7 +151,7 @@
</div>
<br>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Username</b>
</div>
<div class="col-sm-4">
@ -160,7 +160,7 @@
</div>
<br>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Password</b>
</div>
<div class="col-sm-4">
@ -169,7 +169,7 @@
</div>
<br>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Ignored Addresses</b>
</div>
<div class="col-sm-4">
@ -182,7 +182,7 @@
<h4>UI</h4>
<hr/>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Page Size</b>
</div>
<div class="form-group col-sm-4">
@ -198,7 +198,7 @@
</div>
</div>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Page Size Manual Search</b>
</div>
<div class="form-group col-sm-4">
@ -216,7 +216,7 @@
<h4>Logging</h4>
<hr/>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Debug</b>
</div>
<div class="form-group col-sm-1">
@ -231,7 +231,7 @@
<h4>Analytics</h4>
<hr/>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Enabled</b>
</div>
<div class="form-group col-sm-1">
@ -247,7 +247,7 @@
<h4>Updates</h4>
<hr/>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Branch</b>
</div>
<div class="form-group col-sm-4">
@ -258,7 +258,7 @@
</div>
</div>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Automatic</b>
</div>
<div class="form-group col-sm-1">
@ -269,7 +269,7 @@
</div>
</div>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Restart After Update</b>
</div>
<div class="form-group col-sm-1">

@ -30,7 +30,7 @@
<h4>Use Radarr</h4>
<hr/>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Enabled</b>
</div>
<div class="form-group col-sm-1">
@ -46,7 +46,7 @@
<h4>Host</h4>
<hr/>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Hostname or IP Address</b>
</div>
<div class="col-sm-4">
@ -55,7 +55,7 @@
</div>
<br>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Port Number</b>
</div>
<div class="col-sm-4">
@ -64,7 +64,7 @@
</div>
<br>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>URL Base</b>
</div>
<div class="col-sm-4">
@ -73,7 +73,7 @@
</div>
<br>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>SSL Enabled</b>
</div>
<div class="form-group col-sm-1">
@ -84,7 +84,7 @@
</div>
</div>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>API Key</b>
</div>
<div class="col-sm-4">
@ -93,7 +93,7 @@
</div>
<br>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<button type="button" class="btn btn-secondary" id="test_radarr_connection">Test</button>
</div>
<div class="col-sm-4">
@ -105,7 +105,7 @@
<h4>Options</h4>
<hr/>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Minimum Score</b>
</div>
<div class="col-sm-1">
@ -114,7 +114,7 @@
</div>
<br>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Download Only Monitored</b>
</div>
<div class="form-group col-sm-1">
@ -256,7 +256,7 @@
});
// Set Checkbox input values
$('#settings-general-use_radarr').prop('checked', {{'true' if settings.general.getboolean('use_radarr')}});
$('#settings-general-use_radarr').prop('checked', {{'true' if settings.general.getboolean('use_radarr')}}).trigger('change');
$('#settings-radarr-ssl').prop('checked', {{'true' if settings.radarr.getboolean('ssl')}});
$('#settings-radarr-only_monitored').prop('checked', {{'true' if settings.radarr.getboolean('only_monitored')}});

@ -30,7 +30,7 @@
<h4>Use Sonarr</h4>
<hr/>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Enabled</b>
</div>
<div class="form-group col-sm-1">
@ -46,7 +46,7 @@
<h4>Host</h4>
<hr/>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Hostname or IP Address</b>
</div>
<div class="col-sm-4">
@ -55,7 +55,7 @@
</div>
<br>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Port Number</b>
</div>
<div class="col-sm-4">
@ -64,7 +64,7 @@
</div>
<br>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>URL Base</b>
</div>
<div class="col-sm-4">
@ -73,7 +73,7 @@
</div>
<br>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>SSL Enabled</b>
</div>
<div class="form-group col-sm-1">
@ -84,7 +84,7 @@
</div>
</div>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>API Key</b>
</div>
<div class="col-sm-4">
@ -93,7 +93,7 @@
</div>
<br>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<button type="button" class="btn btn-secondary" id="test_sonarr_connection">Test</button>
</div>
<div class="col-sm-4">
@ -105,7 +105,7 @@
<h4>Options</h4>
<hr/>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Minimum Score</b>
</div>
<div class="col-sm-1">
@ -114,7 +114,7 @@
</div>
<br>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Download Only Monitored</b>
</div>
<div class="form-group col-sm-1">
@ -256,7 +256,7 @@
});
// Set Checkbox input values
$('#settings-general-use_sonarr').prop('checked', {{'true' if settings.general.getboolean('use_sonarr')}});
$('#settings-general-use_sonarr').prop('checked', {{'true' if settings.general.getboolean('use_sonarr')}}).trigger('change');
$('#settings-sonarr-ssl').prop('checked', {{'true' if settings.sonarr.getboolean('ssl')}});
$('#settings-sonarr-only_monitored').prop('checked', {{'true' if settings.sonarr.getboolean('only_monitored')}});

File diff suppressed because it is too large Load Diff

@ -14,7 +14,7 @@
<div class="container-fluid" style="padding-top: 3em;">
<h2>About</h2><hr/>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Bazarr Version:</b>
</div>
<div class="col-sm-8">
@ -22,7 +22,7 @@
</div>
</div>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Sonarr Version:</b>
</div>
<div class="col-sm-8">
@ -30,7 +30,7 @@
</div>
</div>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Radarr Version:</b>
</div>
<div class="col-sm-8">
@ -38,7 +38,7 @@
</div>
</div>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Operating System:</b>
</div>
<div class="col-sm-8">
@ -46,7 +46,7 @@
</div>
</div>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Python Version:</b>
</div>
<div class="col-sm-8">
@ -54,7 +54,7 @@
</div>
</div>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Bazarr Directory:</b>
</div>
<div class="col-sm-8">
@ -62,7 +62,7 @@
</div>
</div>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Bazarr Config Directory:</b>
</div>
<div class="col-sm-8">
@ -72,7 +72,7 @@
<br>
<h2>More info</h2><hr/>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Home Page:</b>
</div>
<div class="col-sm-8">
@ -81,7 +81,7 @@
</div>
</div>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Source:</b>
</div>
<div class="col-sm-8">
@ -90,7 +90,7 @@
</div>
</div>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Wiki:</b>
</div>
<div class="col-sm-8">
@ -99,7 +99,7 @@
</div>
</div>
<div class="row">
<div class="col-sm-2 text-right">
<div class="col-sm-3 text-right">
<b>Discord:</b>
</div>
<div class="col-sm-8">

@ -1,247 +0,0 @@
{%- from 'providers.html' import settings_providers1 with context %}
<!DOCTYPE html>
<html lang="en">
<head>
<script src="{{base_url}}static/jquery/jquery-latest.min.js"></script>
<script src="{{base_url}}static/semantic/semantic.min.js"></script>
<script src="{{base_url}}static/jquery/tablesort.js"></script>
<link rel="stylesheet" href="{{base_url}}static/semantic/semantic.min.css">
<link rel="apple-touch-icon" sizes="120x120" href="{{base_url}}static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="{{base_url}}static/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="{{base_url}}static/favicon-16x16.png">
<link rel="manifest" href="{{base_url}}static/manifest.json">
<link rel="mask-icon" href="{{base_url}}static/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="{{base_url}}static/favicon.ico">
<meta name="msapplication-config" content="{{base_url}}static/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<title>Settings - Bazarr</title>
{{ super() }}
<style>
body {
background-color: #272727;
}
#fondblanc {
background-color: #ffffff;
border-radius: 0;
box-shadow: 0 0 5px 5px #ffffff;
margin-top: 32px;
margin-bottom: 3em;
padding: 1em;
}
.ui.tabular.menu > .disabled.item {
opacity: 0.45 !important;
pointer-events: none !important;
}
.browser {
float: left;
border: 1px solid gray;
width: 640px;
height: 480px;
margin: 20px;
}
[data-tooltip]:after {
z-index: 2;
}
</style>
</head>
<body>
<div id='loader' class="ui page dimmer">
<div class="ui indeterminate text loader">Saving Settings...</div>
</div>
<div class="ui modal" id="browsemodal">
<div class="browser"></div>
</div>
<div id="fondblanc" class="ui container">
<form name="wizard_form" id="wizard_form" action="{{base_url}}save_wizard" method="post" class="ui form" autocomplete="off">
<div id="form_validation_error" class="ui error message">
<p>Some fields are incorrect and you cannot continue until you have corrected them. Be sure to check every tab.</p>
</div>
<div class="ui top attached mini steps">
<div class="active step" data-tab="general" id="general_tab">
<i class="setting icon"></i>
<div class="content">
<div class="title">General</div>
<div class="description">General Settings</div>
</div>
</div>
<div class="step" data-tab="subtitles" id="subtitles_tab">
<i class="closed captioning icon"></i>
<div class="content">
<div class="title">Subtitles</div>
<div class="description">Subtitles Settings</div>
</div>
</div>
<div class="step" data-tab="sonarr" id="sonarr_tab">
<i class="play icon"></i>
<div class="content">
<div class="title">Sonarr</div>
<div class="description">Sonarr Settings</div>
</div>
</div>
<div class="step" data-tab="radarr" id="radarr_tab">
<i class="film icon"></i>
<div class="content">
<div class="title">Radarr</div>
<div class="description">Radarr Settings</div>
</div>
</div>
</div>
<div class="ui bottom attached tab segment active" data-tab="general" id="general">
<div class="ui container"><button class="submit ui blue right floated right labeled icon button next1">
<i class="right arrow icon"></i>
Next
</button></div>
{% include 'wizard_general.html' %}
</div>
<div class="ui bottom attached tab segment" data-tab="subtitles" id="subtitles">
<div class="ui container">
<button class="submit ui blue right floated right labeled icon button next2">
<i class="right arrow icon"></i>
Next
</button>
<button class="submit ui blue right floated left labeled icon button prev1">
<i class="left arrow icon"></i>
Prev
</button>
</div>
{% include 'wizard_subtitles.html' %}
</div>
<div class="ui bottom attached tab segment" data-tab="sonarr" id="sonarr">
<div class="ui container"><button class="submit ui blue right floated right labeled icon button next3">
<i class="right arrow icon"></i>
Next
</button>
<button class="submit ui blue right floated left labeled icon button prev2">
<i class="left arrow icon"></i>
Prev
</button></div>
{% include 'wizard_sonarr.html' %}
</div>
<div class="ui bottom attached tab segment" data-tab="radarr" id="radarr">
<div class="ui container"><button class="submit ui blue right floated lright labeled icon button" id="submit" type="submit" value="Submit" form="wizard_form"><i class="save icon"></i>Save</button>
<button class="submit ui blue right floated left labeled icon button prev3">
<i class="left arrow icon"></i>
Prev
</button></div>
{% include 'wizard_radarr.html' %}
</div>
</form>
</div>
{% include 'footer.html' %}
</body>
</html>
<script src="{{base_url}}static/js/wizard_validation.js"></script>
<script>
function getQueryVariable(variable)
{
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
}
return(false);
}
if (getQueryVariable("saved") == 'true') {
new Noty({
text: 'Settings saved.',
timeout: 5000,
progressBar: false,
animation: {
open: null,
close: null
},
killer: true,
type: 'info',
layout: 'bottomRight',
theme: 'semanticui'
}).show();
}
$(function() {
$('.next1').on('click', function(e) {
e.preventDefault();
$('#general').removeClass('active');
$('#subtitles').addClass('active');
$('#subtitles_tab').addClass('active');
$('#general_tab').removeClass('active');
$('#general_tab').addClass('completed');
});
$('.prev1').on('click', function(m) {
m.preventDefault();
$('#general').addClass('active');
$('#subtitles').removeClass('active');
$('#subtitles_tab').removeClass('active');
$('#general_tab').removeClass('completed');
$('#general_tab').addClass('active');
});
$('.next2').on('click', function(e) {
e.preventDefault();
$('#subtitles').removeClass('active');
$('#sonarr').addClass('active');
$('#sonarr_tab').addClass('active');
$('#subtitles_tab').removeClass('active');
$('#subtitles_tab').addClass('completed');
});
$('.prev2').on('click', function(m) {
m.preventDefault();
$('#subtitles').addClass('active');
$('#sonarr').removeClass('active');
$('#sonarr_tab').removeClass('active');
$('#subtitles_tab').removeClass('completed');
$('#subtitles_tab').addClass('active');
});
$('.next3').on('click', function(e) {
e.preventDefault();
$('#sonarr').removeClass('active');
$('#radarr').addClass('active');
$('#radarr_tab').addClass('active');
$('#sonarr_tab').removeClass('active');
$('#sonarr_tab').addClass('completed');
});
$('.prev3').on('click', function(m) {
m.preventDefault();
$('#sonarr').addClass('active');
$('#radarr').removeClass('active');
$('#radarr_tab').removeClass('active');
$('#sonarr_tab').removeClass('completed');
$('#sonarr_tab').addClass('active');
});
});
$(function() {
$('.form').form('validate form');
$('#loader').removeClass('active');
});
$(".form :input").on('change paste keyup focusout', function() {
$('.form').form('validate form');
$('#loader').removeClass('active');
});
</script>

@ -1,201 +0,0 @@
<div class="ui dividing header">Start-Up</div>
<div class="twelve wide column">
<div class="ui grid">
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Listening IP Address</label>
</div>
<div class="five wide column">
<div class='field'>
<div class="ui fluid input">
<input name="settings_general_ip" type="text" value="{{ settings.general.ip }}">
</div>
</div>
</div>
<div class="collapsed center aligned column">
<div class="ui basic icon" data-tooltip="Requires A Restart To Take Effect" data-inverted="">
<i class="yellow warning sign icon"></i>
</div>
</div>
<div class="collapsed center aligned column">
<div class="ui basic icon" data-tooltip="Valid IP4 Address or '0.0.0.0' for all interfaces"
data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Listening Port</label>
</div>
<div class="five wide column">
<div class='field'>
<div class="ui fluid input">
<input name="settings_general_port" type="text" value="{{ settings.general.port }}">
</div>
</div>
</div>
<div class="collapsed center aligned column">
<div class="ui basic icon" data-tooltip="Requires A Restart To Take Effect" data-inverted="">
<i class="yellow warning sign icon"></i>
</div>
</div>
<div class="collapsed center aligned column">
<div class="ui basic icon" data-tooltip="Valid TCP Port (default: 6767)" data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Base URL</label>
</div>
<div class="five wide column">
<div class="ui fluid input">
{% if settings.general.base_url == None %}
{% set base_url = "/" %}
{% else %}
{% set base_url = settings.general.base_url %}
{% endif %}
<input name="settings_general_baseurl" type="text">
</div>
</div>
<div class="collapsed center aligned column">
<div class="ui basic icon" data-tooltip="Requires A Restart To Take Effect" data-inverted="">
<i class="yellow warning sign icon"></i>
</div>
</div>
<div class="collapsed center aligned column">
<div class="ui basic icon" data-tooltip="For Reverse Proxy Support, Default Is '/'" data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
</div>
</div>
<div class="ui dividing header">Path Mappings For TV Shows</div>
<div class="twelve wide column">
<div class="ui grid">
{% if settings.general.path_mappings != None %}
{% set path_substitutions = ast.literal_eval(settings.general.path_mappings) %}
{% else %}
{% set path_substitutions = [] %}
{% endif %}<div class="middle aligned row"><div class="right aligned four wide column">
</div><div class="two wide column"><div class="ui fluid input"><h4 class="ui header">Path for Sonarr:</h4></div></div><div class="collapsed column"><div class="collapsed center aligned column"><div class="ui basic icon" data-tooltip="Root path to the directory Sonarr accesses." data-inverted=""><i class="help circle large icon"></i></div></div></div><div class="two wide center aligned column">
</div><div class="two wide column"><div class="ui fluid input"><h4 class="ui header">Path for Bazarr:</h4></div></div><div class="collapsed column"><div class="collapsed center aligned column"><div class="ui basic icon" data-tooltip="Path that Bazarr should use to access the same directory remotely." data-inverted=""><i class="help circle large icon"></i></div></div></div></div>
{% for x in range(0, 5) %}
{% set path = [] %}
{% if path_substitutions[x] %}
{% set path = path_substitutions[x] %}
{% else %}
{% set path = ["", ""] %}
{% endif %}
<div class="middle aligned row">
<div class="right aligned four wide column">
</div>
<div class="four wide column">
<div class="ui fluid input">
<input name="settings_general_sourcepath[]" type="text">
</div>
</div>
<div class="center aligned column">
<i class="arrow circle right icon"></i>
</div>
<div class="four wide column">
<div class="ui fluid input">
<input name="settings_general_destpath[]" type="text">
</div>
</div>
</div>
{% endfor %}
</div>
</div>
<div class="ui dividing header">Path Mappings For Movies</div>
<div class="twelve wide column">
<div class="ui grid">
{% if settings.general.path_mappings_movie != None %}
{% set path_substitutions_movie = ast.literal_eval(settings.general.path_mappings_movie) %}
{% else %}
{% set path_substitutions_movie = [] %}
{% endif %}
<div class="middle aligned row">
<div class="right aligned four wide column">
</div>
<div class="two wide column">
<div class="ui fluid input">
<h4 class="ui header">
Path for Radarr:
</h4>
</div>
</div>
<div class="collapsed column">
<div class="collapsed center aligned column">
<div class="ui basic icon" data-tooltip="Root path to the directory Radarr accesses."
data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
<div class="two wide center aligned column">
</div>
<div class="two wide column">
<div class="ui fluid input">
<h4 class="ui header">
Path for Bazarr:
</h4>
</div>
</div>
<div class="collapsed column">
<div class="collapsed center aligned column">
<div class="ui basic icon"
data-tooltip="Path that Bazarr should use to access the same directory remotely."
data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
</div>
{% for x in range(0, 5) %}
{% set path_movie = [] %}
{% if path_substitutions_movie[x] %}
{% set path_movie = path_substitutions_movie[x] %}
{% else %}
{% set path_movie = ["", ""] %}
{% endif %}
<div class="middle aligned row">
<div class="right aligned four wide column">
</div>
<div class="four wide column">
<div class="ui fluid input">
<input name="settings_general_sourcepath_movie[]" type="text">
</div>
</div>
<div class="center aligned column">
<i class="arrow circle right icon"></i>
</div>
<div class="four wide column">
<div class="ui fluid input">
<input name="settings_general_destpath_movie[]" type="text">
</div>
</div>
</div>
{% endfor %}
</div>
</div>
<script>
</script>

@ -1,204 +0,0 @@
<div class="ui dividing header">Connection settings</div>
<div class="twelve wide column">
<div class="ui grid">
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Settings Validation:</label>
</div>
<div class="two wide column">
<button id="radarr_validate" class="test ui blue button" type="button">
Test
</button>
</div>
<div class="seven wide column">
<div id="radarr_validated" class="ui read-only checkbox">
<input id="radarr_validated_checkbox" type="checkbox">
<label id="radarr_validation_result">Not Tested Recently</label>
</div>
</div>
</div>
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Use Radarr</label>
</div>
<div class="one wide column">
<div id="settings_use_radarr" class="ui toggle checkbox">
<input name="settings_general_use_radarr" type="checkbox">
<label></label>
</div>
</div>
<div class="collapsed column">
<div class="collapsed center aligned column">
<div class="ui basic icon" data-tooltip="Enable Radarr Integration." data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
</div>
<div class="radarr_hide middle aligned row">
<div class="right aligned four wide column">
<label>Hostname or IP Address</label>
</div>
<div class="five wide column">
<div class='field'>
<div class="ui fluid input">
<input id="settings_radarr_ip" name="settings_radarr_ip" type="text" class="radarr_config" value="{{settings.radarr.ip}}">
</div>
</div>
</div>
<div class="collapsed center aligned column">
<div class="ui basic icon" data-tooltip="Hostname or IP4 Address of Radarr" data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
<div class="radarr_hide middle aligned row">
<div class="right aligned four wide column">
<label>Listening Port</label>
</div>
<div class="five wide column">
<div class='field'>
<div class="ui fluid input">
<input id="settings_radarr_port" name="settings_radarr_port" type="text" class="radarr_config" value="{{settings.radarr.port}}">
</div>
</div>
</div>
<div class="collapsed center aligned column">
<div class="ui basic icon" data-tooltip="TCP Port of Radarr" data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
<div class="radarr_hide middle aligned row">
<div class="right aligned four wide column">
<label>Base URL</label>
</div>
<div class="five wide column">
<div class="ui fluid input">
<input id="settings_radarr_baseurl" name="settings_radarr_baseurl" type="text" class="radarr_config">
</div>
</div>
<div class="collapsed center aligned column">
<div class="ui basic icon" data-tooltip="Base URL for Radarr (default: '/')" data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
<div class="radarr_hide middle aligned row">
<div class="right aligned four wide column">
<label>SSL Enabled</label>
</div>
<div class="one wide column">
<div id="radarr_ssl_div" class="ui toggle checkbox">
<input id="settings_radarr_ssl" name="settings_radarr_ssl" type="checkbox">
<label></label>
</div>
</div>
</div>
<div class="radarr_hide middle aligned row">
<div class="right aligned four wide column">
<label>API Key</label>
</div>
<div class="five wide column">
<div class='field'>
<div class="ui fluid input">
<input id="settings_radarr_apikey" name="settings_radarr_apikey" type="text" class="radarr_config">
</div>
</div>
</div>
<div class="collapsed center aligned column">
<div class="ui basic icon" data-tooltip="API Key for Radarr (32 alphanumeric characters)" data-inverted="">
<i class="help circle large icon"></i>
</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="Only Download Subtitles For Monitored Movies in Radarr." data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(".radarr_hide").hide();
$('#settings_use_radarr').checkbox({
onChecked: function() {
$(".radarr_hide").show();
},
onUnchecked: function() {
$(".radarr_hide").hide();
}
});
if ($('#radarr_ssl_div').data("ssl") === "True") {
$("#radarr_ssl_div").checkbox('check');
} else {
$("#radarr_ssl_div").checkbox('uncheck');
}
if ($('#settings_only_monitored_radarr').data("monitored") === "True") {
$("#settings_only_monitored_radarr").checkbox('check');
} else {
$("#settings_only_monitored_radarr").checkbox('uncheck');
}
$('#radarr_validate').on('click', function() {
if ($('#radarr_ssl_div').checkbox('is checked')) {
protocol = 'https';
} else {
protocol = 'http';
}
radarr_url = $('#settings_radarr_ip').val() + ":" + $('#settings_radarr_port').val() + $('#settings_radarr_baseurl').val().replace(/\/$/, "") + "/api/system/status?apikey=" + $('#settings_radarr_apikey').val();
$.getJSON("{{base_url}}test_url/" + protocol + "/" + encodeURIComponent(radarr_url), function (data) {
if (data.status) {
$('#radarr_validated').checkbox('check');
$('#radarr_validation_result').text('Test successful: Radarr v' + data.version).css('color', 'green');
$('.form').form('validate form');
$('#loader').removeClass('active');
} else {
$('#radarr_validated').checkbox('uncheck');
$('#radarr_validation_result').text('Test Failed').css('color', 'red');
$('.form').form('validate form');
$('#loader').removeClass('active');
}
});
});
$('.radarr_config').on('keyup', function() {
$('#radarr_validated').checkbox('uncheck');
$('#radarr_validation_result').text('You Must Test Your Radarr Connection Settings Before Saving.').css('color', 'red');
$('.form').form('validate form');
$('#loader').removeClass('active');
});
$('#settings_radarr_ssl').on('change', function() {
$('#radarr_validated').checkbox('uncheck');
$('#radarr_validation_result').text('You Must Test Your Radarr Connection Settings Before Saving.').css('color', 'red');
$('.form').form('validate form');
$('#loader').removeClass('active');
});
$("#radarr_validated").checkbox('check');
</script>

@ -1,204 +0,0 @@
<div class="ui dividing header">Connection Settings</div>
<div class="twelve wide column">
<div class="ui grid">
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Settings validation:</label>
</div>
<div class="two wide column">
<button id="sonarr_validate" class="test ui blue button" type="button">
Test
</button>
</div>
<div class="seven wide column">
<div id="sonarr_validated" class="ui read-only checkbox">
<input id="sonarr_validated_checkbox" type="checkbox">
<label id="sonarr_validation_result">Not Tested Recently</label>
</div>
</div>
</div>
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Use Sonarr</label>
</div>
<div class="one wide column">
<div id="settings_use_sonarr" class="ui toggle checkbox">
<input name="settings_general_use_sonarr" type="checkbox">
<label></label>
</div>
</div>
<div class="collapsed column">
<div class="collapsed center aligned column">
<div class="ui basic icon" data-tooltip="Enable Sonarr Integration." data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
</div>
<div class="sonarr_hide middle aligned row">
<div class="right aligned four wide column">
<label>Hostname or IP Address</label>
</div>
<div class="five wide column">
<div class='field'>
<div class="ui fluid input">
<input id="settings_sonarr_ip" name="settings_sonarr_ip" class="sonarr_config" type="text" value="{{settings.sonarr.ip}}">
</div>
</div>
</div>
<div class="collapsed center aligned column">
<div class="ui basic icon" data-tooltip="Hostname or IP4 Address of Sonarr" data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
<div class="sonarr_hide middle aligned row">
<div class="right aligned four wide column">
<label>Listening Port</label>
</div>
<div class="five wide column">
<div class='field'>
<div class="ui fluid input">
<input id="settings_sonarr_port" name="settings_sonarr_port" class="sonarr_config" type="text" value="{{settings.sonarr.port}}">
</div>
</div>
</div>
<div class="collapsed center aligned column">
<div class="ui basic icon" data-tooltip="TCP Port of Sonarr" data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
<div class="sonarr_hide middle aligned row">
<div class="right aligned four wide column">
<label>Base URL</label>
</div>
<div class="five wide column">
<div class="ui fluid input">
<input id="settings_sonarr_baseurl" name="settings_sonarr_baseurl" class="sonarr_config" type="text">
</div>
</div>
<div class="collapsed center aligned column">
<div class="ui basic icon" data-tooltip="Base URL for Sonarr (default: '/')" data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
<div class="sonarr_hide middle aligned row">
<div class="right aligned four wide column">
<label>SSL Enabled</label>
</div>
<div class="one wide column">
<div id="sonarr_ssl_div" class="ui toggle checkbox">
<input id="settings_sonarr_ssl" name="settings_sonarr_ssl" type="checkbox">
<label></label>
</div>
</div>
</div>
<div class="sonarr_hide middle aligned row">
<div class="right aligned four wide column">
<label>API Key</label>
</div>
<div class="five wide column">
<div class='field'>
<div class="ui fluid input">
<input id="settings_sonarr_apikey" name="settings_sonarr_apikey" class="sonarr_config" type="text">
</div>
</div>
</div>
<div class="collapsed center aligned column">
<div class="ui basic icon" data-tooltip="API Key for Sonarr (32 alphanumeric characters)" data-inverted="">
<i class="help circle large icon"></i>
</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="Only Download Subtitles For Monitored Episodes in Sonarr." data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(".sonarr_hide").hide();
$('#settings_use_sonarr').checkbox({
onChecked: function() {
$(".sonarr_hide").show();
},
onUnchecked: function() {
$(".sonarr_hide").hide();
}
});
if ($('#sonarr_ssl_div').data("ssl") === "True") {
$("#sonarr_ssl_div").checkbox('check');
} else {
$("#sonarr_ssl_div").checkbox('uncheck');
}
if ($('#settings_only_monitored_sonarr').data("monitored") === "True") {
$("#settings_only_monitored_sonarr").checkbox('check');
} else {
$("#settings_only_monitored_sonarr").checkbox('uncheck');
}
$('#sonarr_validate').on('click', function() {
if ($('#sonarr_ssl_div').checkbox('is checked')) {
protocol = 'https';
} else {
protocol = 'http';
}
sonarr_url = $('#settings_sonarr_ip').val() + ":" + $('#settings_sonarr_port').val() + $('#settings_sonarr_baseurl').val().replace(/\/$/, "") + "/api/system/status?apikey=" + $('#settings_sonarr_apikey').val();
$.getJSON("{{base_url}}test_url/" + protocol + "/" + encodeURIComponent(sonarr_url), function (data) {
if (data.status) {
$('#sonarr_validated').checkbox('check');
$('#sonarr_validation_result').text('Test Successful: Sonarr v' + data.version).css('color', 'green');
$('.form').form('validate form');
$('#loader').removeClass('active');
} else {
$('#sonarr_validated').checkbox('uncheck');
$('#sonarr_validation_result').text('Test Failed').css('color', 'red');
$('.form').form('validate form');
$('#loader').removeClass('active');
}
});
});
$('.sonarr_config').on('keyup', function() {
$('#sonarr_validated').checkbox('uncheck');
$('#sonarr_validation_result').text('You Must Test Your Sonarr Connection Settings Before Saving.').css('color', 'red');
$('.form').form('validate form');
$('#loader').removeClass('active');
});
$('#settings_sonarr_ssl').on('change', function() {
$('#sonarr_validated').checkbox('uncheck');
$('#sonarr_validation_result').text('You Must Test Your Sonarr Connection Settings Before Saving.').css('color', 'red');
$('.form').form('validate form');
$('#loader').removeClass('active');
});
$("#sonarr_validated").checkbox('check');
</script>

@ -1,449 +0,0 @@
<div class="ui dividing header">Subtitles options</div>
<div class="twelve wide column">
<div class="ui grid">
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Subtitle Folder</label>
</div>
<div class="five wide column">
<select name="settings_subfolder" id="settings_subfolder"
class="ui fluid selection dropdown">
<option value="current">Alongside Media File</option>
<option value="relative">Relative Path To Media File</option>
<option value="absolute">Absolute Path</option>
</select>
</div>
<div class="collapsed center aligned column">
<div class="ui basic icon"
data-tooltip='Choose the folder you want to store/read the Subtitles in'
data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
<div class="middle aligned row subfolder">
<div class="two wide column"></div>
<div class="right aligned four wide column">
<label>Custom Subtitle Folder</label>
</div>
<div class="five wide column">
<div class='field'>
<div class="ui fluid input">
<input id="settings_subfolder_custom" name="settings_subfolder_custom"
type="text" value="{{ settings.general.subfolder_custom }}">
</div>
</div>
</div>
<div class="collapsed center aligned column">
<div class="ui basic icon"
data-tooltip='Choose your own folder for Subtitles' data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Use Embedded Subtitles</label>
</div>
<div class="one wide column">
<div id="settings_embedded" class="ui toggle checkbox"
data-embedded={{ settings.general.getboolean('use_embedded_subs') }}>
<input name="settings_general_embedded" type="checkbox">
<label></label>
</div>
</div>
<div class="collapsed column">
<div class="collapsed center aligned column">
<div class="ui basic icon"
data-tooltip="Use Embedded Subtitles in media files when determining missing ones."
data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
</div>
</div>
</div>
{% include('providers.html') %}
<div class="ui dividing header">Subtitles languages</div>
<div class="twelve wide column">
<div class="ui grid">
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Single Language</label>
</div>
<div class="one wide column">
<div id="settings_single_language" class="ui toggle checkbox"
data-single-language={{ settings.general.getboolean('single_language') }}>
<input name="settings_general_single_language" type="checkbox">
<label></label>
</div>
</div>
<div class="one wide column">
<div class="collapsed center aligned column">
<div class="ui basic icon"
data-tooltip="Download a single subtitle file without adding the language code to the filename."
data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
<div class="ten wide column">
<div class="fluid column">
<div style="color: red;">We don't recommend enabling this option unless absolutely required (ie:
media player not supporting language code in subtitles filename). Results may vary.
</div>
</div>
</div>
</div>
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Enabled Languages</label>
</div>
<div class="eleven wide column">
<div class='field'>
<select name="settings_subliminal_languages" id="settings_languages" multiple=""
class="ui fluid search selection dropdown">
<option value="">Languages</option>
{% set enabled_languages = [] %}
{% for language in settings_languages %}
<option value="{{ language['code2'] }}">{{ language['name'] }}</option>
{% if language['enabled'] == True %}
{{ enabled_languages.append(language['code2']|string) }}
{% endif %}
{% endfor %}
</select>
</div>
</div>
</div>
</div>
</div>
<div class="ui dividing header">Series default settings</div>
<div class="twelve wide column">
<div class="ui grid">
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Default Enabled</label>
</div>
<div class="one wide column">
<div class="nine wide column">
<div id="settings_serie_default_enabled_div" class="ui toggle checkbox">
<input name="settings_serie_default_enabled" id="settings_serie_default_enabled"
type="checkbox">
<label></label>
</div>
</div>
</div>
<div class="collapsed column">
<div class="collapsed center aligned column">
<div class="ui basic icon"
data-tooltip="Apply only to Series added to Bazarr after enabling this option."
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>Languages</label>
</div>
<div class="eleven wide column">
<div class='field'>
<select name="settings_serie_default_languages" id="settings_serie_default_languages" multiple=""
class="ui fluid search selection dropdown">
{% if not settings.general.getboolean('single_language') %}
<option value="">Languages</option>
{% else %}
<option value="None">None</option>
{% endif %}
</select>
</div>
</div>
</div>
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Hearing-Impaired</label>
</div>
<div class="eleven wide column">
<div class="nine wide column">
<div id="settings_serie_default_hi_div" class="ui toggle checkbox">
<input name="settings_serie_default_hi" id="settings_serie_default_hi" type="checkbox">
<label></label>
</div>
</div>
</div>
</div>
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Forced</label>
</div>
<div class="eleven wide column">
<div class='field'>
<select name="settings_serie_default_forced" id="settings_serie_default_forced"
class="ui fluid selection dropdown">
<option value="False">False</option>
<option value="True">True</option>
<option value="Both">Both</option>
</select>
</div>
</div>
</div>
</div>
</div>
<div class="ui dividing header">Movie Default Settings</div>
<div class="twelve wide column">
<div class="ui grid">
<div class="middle aligned row">
<div class="right aligned four wide column">
<label>Default Enabled</label>
</div>
<div class="one wide column">
<div class="nine wide column">
<div id="settings_movie_default_enabled_div" class="ui toggle checkbox">
<input name="settings_movie_default_enabled" id="settings_movie_default_enabled"
type="checkbox">
<label></label>
</div>
</div>
</div>
<div class="collapsed column">
<div class="collapsed center aligned column">
<div class="ui basic icon"
data-tooltip="Apply only to Movies added to Bazarr after enabling this option."
data-inverted="">
<i class="help circle large icon"></i>
</div>
</div>
</div>
</div>
<div class="middle aligned row">
<div id="movie_default_languages_label" class="right aligned four wide column">
<label>Languages</label>
</div>
<div class="eleven wide column">
<div class='field'>
<select name="settings_movie_default_languages" id="settings_movie_default_languages" multiple=""
class="ui fluid search selection dropdown">
%if not settings.general.getboolean('single_language'):
<option value="">Languages</option>
%else:
<option value="None">None</option>
%end
</select>
</div>
</div>
</div>
<div class="middle aligned row">
<div id="movie_default_hi_label" class="right aligned four wide column">
<label>Hearing-Impaired</label>
</div>
<div class="eleven wide column">
<div class="nine wide column">
<div id="settings_movie_default_hi_div" class="ui toggle checkbox">
<input name="settings_movie_default_hi" id="settings_movie_default_hi" type="checkbox">
<label></label>
</div>
</div>
</div>
</div>
<div class="middle aligned row">
<div id="movie_default_forced_label" class="right aligned four wide column">
<label>Forced</label>
</div>
<div class="eleven wide column">
<div class='field'>
<select name="settings_movie_default_forced" id="settings_movie_default_forced"
class="ui fluid selection dropdown">
<option value="False">False</option>
<option value="True">True</option>
<option value="Both">Both</option>
</select>
</div>
</div>
</div>
</div>
</div>
<script>
if ($('#settings_embedded').data("embedded") === "True") {
$("#settings_embedded").checkbox('check');
} else {
$("#settings_embedded").checkbox('uncheck');
}
if ($('#settings_single_language').data("single-language") === "True") {
$("#settings_single_language").checkbox('check');
} else {
$("#settings_single_language").checkbox('uncheck');
}
$('#settings_languages').dropdown('setting', 'onAdd', function (val, txt) {
$("#settings_serie_default_languages").append(
$("<option></option>").attr("value", val).text(txt)
);
$("#settings_movie_default_languages").append(
$("<option></option>").attr("value", val).text(txt)
)
});
$('#settings_languages').dropdown('setting', 'onRemove', function (val) {
$("#settings_serie_default_languages").dropdown('remove selected', val);
$("#settings_serie_default_languages option[value='" + val + "']").remove();
$("#settings_movie_default_languages").dropdown('remove selected', val);
$("#settings_movie_default_languages option[value='" + val + "']").remove();
});
if ($('#settings_serie_default_enabled_div').data("enabled") === "True") {
$("#settings_serie_default_enabled_div").checkbox('check');
} else {
$("#settings_serie_default_enabled_div").checkbox('uncheck');
}
if ($('#settings_serie_default_enabled_div').data("enabled") === "True") {
$("#settings_serie_default_languages").removeClass('disabled');
$("#settings_serie_default_hi_div").removeClass('disabled');
$("#settings_serie_default_forced_div").removeClass('disabled');
} else {
$("#settings_serie_default_languages").addClass('disabled');
$("#settings_serie_default_hi_div").addClass('disabled');
$("#settings_serie_default_forced_div").addClass('disabled');
}
$('#settings_serie_default_enabled_div').checkbox({
onChecked: function () {
$("#settings_serie_default_languages").parent().removeClass('disabled');
$("#settings_serie_default_hi_div").removeClass('disabled');
$("#settings_serie_default_forced").parent().removeClass('disabled');
},
onUnchecked: function () {
$("#settings_serie_default_languages").parent().addClass('disabled');
$("#settings_serie_default_hi_div").addClass('disabled');
$("#settings_serie_default_forced").parent().addClass('disabled');
}
});
if ($('#settings_serie_default_hi_div').data("hi") === "True") {
$("#settings_serie_default_hi_div").checkbox('check');
} else {
$("#settings_serie_default_hi_div").checkbox('uncheck');
}
if ($('#settings_movie_default_enabled_div').data("enabled") === "True") {
$("#settings_movie_default_enabled_div").checkbox('check');
} else {
$("#settings_movie_default_enabled_div").checkbox('uncheck');
}
if ($('#settings_movie_default_enabled_div').data("enabled") === "True") {
$("#settings_movie_default_languages").removeClass('disabled');
$("#settings_movie_default_hi_div").removeClass('disabled');
$("#settings_movie_default_forced_div").removeClass('disabled');
} else {
$("#settings_movie_default_languages").addClass('disabled');
$("#settings_movie_default_hi_div").addClass('disabled');
$("#settings_movie_default_forced_div").addClass('disabled');
}
$('#settings_movie_default_enabled_div').checkbox({
onChecked: function () {
$("#settings_movie_default_languages").parent().removeClass('disabled');
$("#settings_movie_default_hi_div").removeClass('disabled');
$("#settings_movie_default_forced").parent().removeClass('disabled');
},
onUnchecked: function () {
$("#settings_movie_default_languages").parent().addClass('disabled');
$("#settings_movie_default_hi_div").addClass('disabled');
$("#settings_movie_default_forced").parent().addClass('disabled');
}
});
if ($('#settings_movie_default_hi_div').data("hi") === "True") {
$("#settings_movie_default_hi_div").checkbox('check');
} else {
$("#settings_movie_default_hi_div").checkbox('uncheck');
}
if ($("#settings_single_language").checkbox('is checked')) {
$("#settings_serie_default_languages").parent().removeClass('multiple');
$("#settings_serie_default_languages").removeAttr('multiple');
$("#settings_movie_default_languages").parent().removeClass('multiple');
$("#settings_movie_default_languages").removeAttr('multiple');
} else {
$("#settings_serie_default_languages").parent().addClass('multiple');
$("#settings_serie_default_languages").attr('multiple');
$("#settings_movie_default_languages").parent().addClass('multiple');
$("#settings_movie_default_languages").attr('multiple');
}
$("#settings_single_language").on('change', function () {
if ($("#settings_single_language").checkbox('is checked')) {
$("#settings_serie_default_languages").dropdown('clear');
$("#settings_movie_default_languages").dropdown('clear');
$("#settings_serie_default_languages").prepend("<option value='None' selected='selected'>None</option>");
$("#settings_movie_default_languages").prepend("<option value='None' selected='selected'>None</option>");
$("#settings_serie_default_languages").parent().removeClass('multiple');
$("#settings_serie_default_languages").removeAttr('multiple');
$("#settings_movie_default_languages").parent().removeClass('multiple');
$("#settings_movie_default_languages").removeAttr('multiple');
} else {
$("#settings_serie_default_languages").dropdown('clear');
$("#settings_movie_default_languages").dropdown('clear');
$("#settings_serie_default_languages option[value='None']").remove();
$("#settings_movie_default_languages option[value='None']").remove();
$("#settings_serie_default_languages").parent().addClass('multiple');
$("#settings_serie_default_languages").attr('multiple');
$("#settings_movie_default_languages").parent().addClass('multiple');
$("#settings_movie_default_languages").attr('multiple');
}
});
$('#settings_languages').dropdown('clear');
$('#settings_languages').dropdown('set selected', {{ enabled_languages|safe }});
$('#settings_subfolder').dropdown('clear');
$('#settings_subfolder').dropdown('set selected', '{{ settings.general.subfolder }}');
{% if settings.general.serie_default_language != 'None' %}
$('#settings_serie_default_languages').dropdown('set selected', {{ settings.general.serie_default_language|safe }});
{% endif %}
{% if settings.general.movie_default_language != 'None' %}
$('#settings_movie_default_languages').dropdown('set selected', {{ settings.general.movie_default_language|safe }});
{% endif %}
$('#settings_serie_default_forced').dropdown('set selected', '{{ settings.general.serie_default_forced }}');
$('#settings_movie_default_forced').dropdown('set selected', '{{ settings.general.movie_default_forced }}');
$('#settings_languages').dropdown('setting', 'onChange', function () {
$('.form').form('validate field', 'settings_subliminal_languages');
});
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();
}
});
</script>
Loading…
Cancel
Save