mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-06-28 09:24:56 -04:00
Fixed profiles sync with Sonarr and Radarr. #2932
This commit is contained in:
parent
794b0067b0
commit
71cd0c80c7
2 changed files with 16 additions and 13 deletions
|
@ -16,7 +16,8 @@ def get_profile_list():
|
||||||
f"apikey={apikey_radarr}")
|
f"apikey={apikey_radarr}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
profiles_json = requests.get(url_radarr_api_movies, timeout=int(settings.radarr.http_timeout), verify=False, headers=HEADERS)
|
profiles_json = requests.get(url_radarr_api_movies, timeout=int(settings.radarr.http_timeout), verify=False,
|
||||||
|
headers=HEADERS)
|
||||||
except requests.exceptions.ConnectionError:
|
except requests.exceptions.ConnectionError:
|
||||||
logging.exception("BAZARR Error trying to get profiles from Radarr. Connection Error.")
|
logging.exception("BAZARR Error trying to get profiles from Radarr. Connection Error.")
|
||||||
except requests.exceptions.Timeout:
|
except requests.exceptions.Timeout:
|
||||||
|
@ -27,15 +28,15 @@ def get_profile_list():
|
||||||
# Parsing data returned from radarr
|
# Parsing data returned from radarr
|
||||||
if get_radarr_info.is_legacy():
|
if get_radarr_info.is_legacy():
|
||||||
for profile in profiles_json.json():
|
for profile in profiles_json.json():
|
||||||
|
if 'language' in profile:
|
||||||
profiles_list.append([profile['id'], profile['language'].capitalize()])
|
profiles_list.append([profile['id'], profile['language'].capitalize()])
|
||||||
else:
|
else:
|
||||||
for profile in profiles_json.json():
|
for profile in profiles_json.json():
|
||||||
|
if 'language' in profile and 'name' in profile['language']:
|
||||||
profiles_list.append([profile['id'], profile['language']['name'].capitalize()])
|
profiles_list.append([profile['id'], profile['language']['name'].capitalize()])
|
||||||
|
|
||||||
return profiles_list
|
return profiles_list
|
||||||
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def get_tags():
|
def get_tags():
|
||||||
apikey_radarr = settings.radarr.apikey
|
apikey_radarr = settings.radarr.apikey
|
||||||
|
|
|
@ -33,13 +33,15 @@ def get_profile_list():
|
||||||
except requests.exceptions.RequestException:
|
except requests.exceptions.RequestException:
|
||||||
logging.exception("BAZARR Error trying to get profiles from Sonarr.")
|
logging.exception("BAZARR Error trying to get profiles from Sonarr.")
|
||||||
return None
|
return None
|
||||||
|
else:
|
||||||
# Parsing data returned from Sonarr
|
# Parsing data returned from Sonarr
|
||||||
if get_sonarr_info.is_legacy():
|
if get_sonarr_info.is_legacy():
|
||||||
for profile in profiles_json.json():
|
for profile in profiles_json.json():
|
||||||
|
if 'language' in profile:
|
||||||
profiles_list.append([profile['id'], profile['language'].capitalize()])
|
profiles_list.append([profile['id'], profile['language'].capitalize()])
|
||||||
else:
|
else:
|
||||||
for profile in profiles_json.json():
|
for profile in profiles_json.json():
|
||||||
|
if 'name' in profile:
|
||||||
profiles_list.append([profile['id'], profile['name'].capitalize()])
|
profiles_list.append([profile['id'], profile['name'].capitalize()])
|
||||||
|
|
||||||
return profiles_list
|
return profiles_list
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue