diff options
author | morpheus65535 <[email protected]> | 2018-09-13 00:32:09 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2018-09-13 00:32:09 -0400 |
commit | e42d1e2dd2f5876035bbbec16496c10adeb0a2f2 (patch) | |
tree | b104fad8d84c693a9509a38502e0782e50087289 | |
parent | da7c1aa5adb1b3336b7a46d4aed706b2116ec0ad (diff) | |
download | bazarr-e42d1e2dd2f5876035bbbec16496c10adeb0a2f2.tar.gz bazarr-e42d1e2dd2f5876035bbbec16496c10adeb0a2f2.zip |
Fix for #80
-rw-r--r-- | bazarr.py | 8 | ||||
-rw-r--r-- | views/settings.tpl | 16 |
2 files changed, 12 insertions, 12 deletions
@@ -1690,13 +1690,13 @@ def api_history(): c.close() return dict(subtitles=data) -@route(base_url + 'test_url/<url:path>', method='GET') +@route(base_url + 'test_url/<protocol>/<url:path>', method='GET') @custom_auth_basic(check_credentials) -def test_url(url): +def test_url(protocol, url): try: - result = requests.get(url).json()['version'] + result = requests.get(protocol + "://" + url).json()['version'] except: - return dict(status=False, version=result) + return dict(status=False) else: return dict(status=True, version=result) diff --git a/views/settings.tpl b/views/settings.tpl index 2cf51b433..00b4be5b2 100644 --- a/views/settings.tpl +++ b/views/settings.tpl @@ -1732,13 +1732,13 @@ $('#sonarr_validate').click(function() {
if ($('#sonarr_ssl_div').checkbox('is checked')) {
- sonarr_url = 'https://';
+ protocol = 'https';
} else {
- sonarr_url = 'http://';
+ protocol = 'http';
}
- sonarr_url += $('#settings_sonarr_ip').val() + ":" + $('#settings_sonarr_port').val() + "/" + $('#settings_sonarr_baseurl').val().replace(/^\/|\/$/g, '') + "/api/system/status?apikey=" + $('#settings_sonarr_apikey').val();
+ sonarr_url = $('#settings_sonarr_ip').val() + ":" + $('#settings_sonarr_port').val() + "/" + $('#settings_sonarr_baseurl').val().replace(/^\/|\/$/g, '') + "/api/system/status?apikey=" + $('#settings_sonarr_apikey').val();
- $.getJSON("{{base_url}}test_url/" + encodeURIComponent(sonarr_url), function (data) {
+ $.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');
@@ -1771,13 +1771,13 @@ $('#radarr_validate').click(function() {
if ($('#radarr_ssl_div').checkbox('is checked')) {
- radarr_url = 'https://';
+ protocol = 'https';
} else {
- radarr_url = 'http://';
+ protocol = 'http';
}
- radarr_url += $('#settings_radarr_ip').val() + ":" + $('#settings_radarr_port').val() + "/" + $('#settings_radarr_baseurl').val().replace(/^\/|\/$/g, '') + "/api/system/status?apikey=" + $('#settings_radarr_apikey').val();
+ radarr_url = $('#settings_radarr_ip').val() + ":" + $('#settings_radarr_port').val() + "/" + $('#settings_radarr_baseurl').val().replace(/^\/|\/$/g, '') + "/api/system/status?apikey=" + $('#settings_radarr_apikey').val();
- $.getJSON("{{base_url}}test_url/" + encodeURIComponent(radarr_url), function (data) {
+ $.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');
|