From ea5bf9ad072c73874fcf39fef45f6fc718a4e616 Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Thu, 1 Dec 2022 16:52:42 -0500 Subject: [PATCH] Removed call to deprecated language profile endpoint in Sonarr v4. #1998 --- bazarr/sonarr/sync/utils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bazarr/sonarr/sync/utils.py b/bazarr/sonarr/sync/utils.py index 13f00b61a..031a9c9c9 100644 --- a/bazarr/sonarr/sync/utils.py +++ b/bazarr/sonarr/sync/utils.py @@ -16,6 +16,9 @@ def get_profile_list(): if get_sonarr_info.is_legacy(): url_sonarr_api_series = url_sonarr() + "/api/profile?apikey=" + apikey_sonarr else: + if not get_sonarr_info.version().startswith('3.'): + # return an empty list when using Sonarr >= v4 that does not support series languages profiles anymore + return profiles_list url_sonarr_api_series = url_sonarr() + "/api/v3/languageprofile?apikey=" + apikey_sonarr try: @@ -30,10 +33,6 @@ def get_profile_list(): logging.exception("BAZARR Error trying to get profiles from Sonarr.") return None - # return an empty list when using Sonarr v4 that do not support series languages profiles anymore - if profiles_json.status_code == 404: - return profiles_list - # Parsing data returned from Sonarr if get_sonarr_info.is_legacy(): for profile in profiles_json.json():