summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2022-03-02 06:34:43 -0500
committermorpheus65535 <[email protected]>2022-03-02 06:34:43 -0500
commit4b84a9c64c90d8872266889443ffaa0e44465087 (patch)
treec876b1a24e34c80dce6e411f3a4cabc836bbda88
parent6b65034810a7cc681c78d2cbd2dff7d4e7bdaec1 (diff)
downloadbazarr-4b84a9c64c90d8872266889443ffaa0e44465087.tar.gz
bazarr-4b84a9c64c90d8872266889443ffaa0e44465087.zip
Fixed GetSonarrInfo.version() to make sure it doesn't prevent Bazarr startup.
-rw-r--r--bazarr/utils.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/bazarr/utils.py b/bazarr/utils.py
index 6a3cf8951..d16028921 100644
--- a/bazarr/utils.py
+++ b/bazarr/utils.py
@@ -258,8 +258,12 @@ class GetSonarrInfo:
else:
raise json.decoder.JSONDecodeError
except json.decoder.JSONDecodeError:
- sv = url_sonarr() + "/api/v3/system/status?apikey=" + settings.sonarr.apikey
- sonarr_version = requests.get(sv, timeout=60, verify=False, headers=headers).json()['version']
+ try:
+ sv = url_sonarr() + "/api/v3/system/status?apikey=" + settings.sonarr.apikey
+ sonarr_version = requests.get(sv, timeout=60, verify=False, headers=headers).json()['version']
+ except json.decoder.JSONDecodeError:
+ logging.debug('BAZARR cannot get Sonarr version')
+ sonarr_version = 'unknown'
except Exception:
logging.debug('BAZARR cannot get Sonarr version')
sonarr_version = 'unknown'