mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-02-16 10:53:13 +08:00
Fix for Sonarr and Radarr settings testing
This commit is contained in:
parent
aa952e7bce
commit
46d8c49355
2 changed files with 3 additions and 3 deletions
|
@ -1750,7 +1750,7 @@ def api_history():
|
||||||
@custom_auth_basic(check_credentials)
|
@custom_auth_basic(check_credentials)
|
||||||
def test_url(protocol, url):
|
def test_url(protocol, url):
|
||||||
try:
|
try:
|
||||||
result = requests.get(protocol + "://" + url).json()['version']
|
result = requests.get(protocol + "://" + url, allow_redirects=False).json()['version']
|
||||||
except:
|
except:
|
||||||
return dict(status=False)
|
return dict(status=False)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -1882,7 +1882,7 @@
|
||||||
} else {
|
} else {
|
||||||
protocol = '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(/\/$/, "") + "/api/system/status?apikey=" + $('#settings_sonarr_apikey').val();
|
||||||
|
|
||||||
$.getJSON("{{base_url}}test_url/" + protocol + "/" + encodeURIComponent(sonarr_url), function (data) {
|
$.getJSON("{{base_url}}test_url/" + protocol + "/" + encodeURIComponent(sonarr_url), function (data) {
|
||||||
if (data.status) {
|
if (data.status) {
|
||||||
|
@ -1921,7 +1921,7 @@
|
||||||
} else {
|
} else {
|
||||||
protocol = '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(/\/$/, "") + "/api/system/status?apikey=" + $('#settings_radarr_apikey').val();
|
||||||
|
|
||||||
$.getJSON("{{base_url}}test_url/" + protocol + "/" + encodeURIComponent(radarr_url), function (data) {
|
$.getJSON("{{base_url}}test_url/" + protocol + "/" + encodeURIComponent(radarr_url), function (data) {
|
||||||
if (data.status) {
|
if (data.status) {
|
||||||
|
|
Loading…
Reference in a new issue