This commit is contained in:
Louis Vézina 2020-03-08 18:07:10 -04:00
parent c7c7a23f58
commit 978f9aeded
1 changed files with 12 additions and 5 deletions

View File

@ -25,6 +25,8 @@ def update_all_movies():
def update_movies():
logging.debug('BAZARR Starting movie sync from Radarr.')
apikey_radarr = settings.radarr.apikey
radarr_version = get_radarr_version()
movie_default_enabled = settings.general.getboolean('movie_default_enabled')
movie_default_language = settings.general.movie_default_language
movie_default_hi = settings.general.movie_default_hi
@ -130,6 +132,8 @@ def update_movies():
videoCodec = None
audioCodec = None
audio_language = profile_id_to_language(movie['qualityProfileId'], audio_profiles)
# Add movies in radarr to current movies list
current_movies_radarr.append(six.text_type(movie['tmdbId']))
@ -140,7 +144,7 @@ def update_movies():
'tmdbId': six.text_type(movie["tmdbId"]),
'poster': poster,
'fanart': fanart,
'audio_language': profile_id_to_language(movie['qualityProfileId'], audio_profiles),
'audio_language': audio_language,
'sceneName': sceneName,
'monitored': six.text_type(bool(movie['monitored'])),
'year': six.text_type(movie['year']),
@ -165,7 +169,7 @@ def update_movies():
'overview': overview,
'poster': poster,
'fanart': fanart,
'audio_language': profile_id_to_language(movie['qualityProfileId'], audio_profiles),
'audio_language': audio_language,
'sceneName': sceneName,
'monitored': six.text_type(bool(movie['monitored'])),
'sortTitle': movie['sortTitle'],
@ -189,7 +193,7 @@ def update_movies():
'overview': overview,
'poster': poster,
'fanart': fanart,
'audio_language': profile_id_to_language(movie['qualityProfileId'], audio_profiles),
'audio_language': audio_language,
'sceneName': sceneName,
'monitored': six.text_type(bool(movie['monitored'])),
'sortTitle': movie['sortTitle'],
@ -275,8 +279,11 @@ def get_profile_list():
radarr_version = get_radarr_version()
profiles_list = []
# Get profiles data from radarr
if radarr_version.startswith('0'):
url_radarr_api_movies = url_radarr() + "/api/profile?apikey=" + apikey_radarr
else:
url_radarr_api_movies = url_radarr() + "/api/v3/qualityprofile?apikey=" + apikey_radarr
url_radarr_api_movies = url_radarr() + "/api/profile?apikey=" + apikey_radarr
try:
profiles_json = requests.get(url_radarr_api_movies, timeout=60, verify=False)
except requests.exceptions.ConnectionError as errc:
@ -290,7 +297,7 @@ def get_profile_list():
if radarr_version.startswith('0'):
for profile in profiles_json.json():
profiles_list.append([profile['id'], profile['language'].capitalize()])
elif radarr_version.startswith('2'):
else:
for profile in profiles_json.json():
profiles_list.append([profile['id'], profile['language']['name'].capitalize()])