diff options
author | Louis Vézina <[email protected]> | 2019-09-29 22:03:36 -0400 |
---|---|---|
committer | Louis Vézina <[email protected]> | 2019-09-29 22:03:36 -0400 |
commit | 4a217fa90eb419d01e2d76599c62bb19a9483421 (patch) | |
tree | c3ca28a6ed2b3349d981aae122e5de7cbc1aa6f1 | |
parent | 25c79d929fd45e4aa2165add4c77320ced29afdd (diff) | |
download | bazarr-4a217fa90eb419d01e2d76599c62bb19a9483421.tar.gz bazarr-4a217fa90eb419d01e2d76599c62bb19a9483421.zip |
Added logging in case Bazarr cannot get Sonarr or Radarr version #596
-rw-r--r-- | bazarr/utils.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/bazarr/utils.py b/bazarr/utils.py index c3dde6c56..e431d996e 100644 --- a/bazarr/utils.py +++ b/bazarr/utils.py @@ -100,12 +100,11 @@ def get_sonarr_version(): use_sonarr = settings.general.getboolean('use_sonarr') apikey_sonarr = settings.sonarr.apikey sv = url_sonarr + "/api/system/status?apikey=" + apikey_sonarr - sonarr_version = '' if use_sonarr: try: - sonarr_version = requests.get(sv, timeout=15, verify=False).json()['version'] - except: - sonarr_version = '' + sonarr_version = requests.get(sv, timeout=30, verify=False).json()['version'] + except Exception as e: + logging.DEBUG('BAZARR cannot get Sonarr version') return sonarr_version @@ -114,11 +113,10 @@ def get_radarr_version(): use_radarr = settings.general.getboolean('use_radarr') apikey_radarr = settings.radarr.apikey rv = url_radarr + "/api/system/status?apikey=" + apikey_radarr - radarr_version = '' if use_radarr: try: - radarr_version = requests.get(rv, timeout=15, verify=False).json()['version'] - except: - radarr_version = '' + radarr_version = requests.get(rv, timeout=30, verify=False).json()['version'] + except Exception as e: + logging.DEBUG('BAZARR cannot get Radarr version') return radarr_version |