Removed call to deprecated language profile endpoint in Sonarr v4. #1998

This commit is contained in:
morpheus65535 2022-12-01 16:52:42 -05:00
parent 7a43e284ae
commit ea5bf9ad07
1 changed files with 3 additions and 4 deletions

View File

@ -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():