mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-10 08:47:52 +08:00
Fix for #851
This commit is contained in:
parent
c7c7a23f58
commit
978f9aeded
1 changed files with 12 additions and 5 deletions
|
@ -25,6 +25,8 @@ def update_all_movies():
|
||||||
def update_movies():
|
def update_movies():
|
||||||
logging.debug('BAZARR Starting movie sync from Radarr.')
|
logging.debug('BAZARR Starting movie sync from Radarr.')
|
||||||
apikey_radarr = settings.radarr.apikey
|
apikey_radarr = settings.radarr.apikey
|
||||||
|
|
||||||
|
radarr_version = get_radarr_version()
|
||||||
movie_default_enabled = settings.general.getboolean('movie_default_enabled')
|
movie_default_enabled = settings.general.getboolean('movie_default_enabled')
|
||||||
movie_default_language = settings.general.movie_default_language
|
movie_default_language = settings.general.movie_default_language
|
||||||
movie_default_hi = settings.general.movie_default_hi
|
movie_default_hi = settings.general.movie_default_hi
|
||||||
|
@ -130,6 +132,8 @@ def update_movies():
|
||||||
videoCodec = None
|
videoCodec = None
|
||||||
audioCodec = None
|
audioCodec = None
|
||||||
|
|
||||||
|
audio_language = profile_id_to_language(movie['qualityProfileId'], audio_profiles)
|
||||||
|
|
||||||
# Add movies in radarr to current movies list
|
# Add movies in radarr to current movies list
|
||||||
current_movies_radarr.append(six.text_type(movie['tmdbId']))
|
current_movies_radarr.append(six.text_type(movie['tmdbId']))
|
||||||
|
|
||||||
|
@ -140,7 +144,7 @@ def update_movies():
|
||||||
'tmdbId': six.text_type(movie["tmdbId"]),
|
'tmdbId': six.text_type(movie["tmdbId"]),
|
||||||
'poster': poster,
|
'poster': poster,
|
||||||
'fanart': fanart,
|
'fanart': fanart,
|
||||||
'audio_language': profile_id_to_language(movie['qualityProfileId'], audio_profiles),
|
'audio_language': audio_language,
|
||||||
'sceneName': sceneName,
|
'sceneName': sceneName,
|
||||||
'monitored': six.text_type(bool(movie['monitored'])),
|
'monitored': six.text_type(bool(movie['monitored'])),
|
||||||
'year': six.text_type(movie['year']),
|
'year': six.text_type(movie['year']),
|
||||||
|
@ -165,7 +169,7 @@ def update_movies():
|
||||||
'overview': overview,
|
'overview': overview,
|
||||||
'poster': poster,
|
'poster': poster,
|
||||||
'fanart': fanart,
|
'fanart': fanart,
|
||||||
'audio_language': profile_id_to_language(movie['qualityProfileId'], audio_profiles),
|
'audio_language': audio_language,
|
||||||
'sceneName': sceneName,
|
'sceneName': sceneName,
|
||||||
'monitored': six.text_type(bool(movie['monitored'])),
|
'monitored': six.text_type(bool(movie['monitored'])),
|
||||||
'sortTitle': movie['sortTitle'],
|
'sortTitle': movie['sortTitle'],
|
||||||
|
@ -189,7 +193,7 @@ def update_movies():
|
||||||
'overview': overview,
|
'overview': overview,
|
||||||
'poster': poster,
|
'poster': poster,
|
||||||
'fanart': fanart,
|
'fanart': fanart,
|
||||||
'audio_language': profile_id_to_language(movie['qualityProfileId'], audio_profiles),
|
'audio_language': audio_language,
|
||||||
'sceneName': sceneName,
|
'sceneName': sceneName,
|
||||||
'monitored': six.text_type(bool(movie['monitored'])),
|
'monitored': six.text_type(bool(movie['monitored'])),
|
||||||
'sortTitle': movie['sortTitle'],
|
'sortTitle': movie['sortTitle'],
|
||||||
|
@ -275,8 +279,11 @@ def get_profile_list():
|
||||||
radarr_version = get_radarr_version()
|
radarr_version = get_radarr_version()
|
||||||
profiles_list = []
|
profiles_list = []
|
||||||
# Get profiles data from radarr
|
# 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:
|
try:
|
||||||
profiles_json = requests.get(url_radarr_api_movies, timeout=60, verify=False)
|
profiles_json = requests.get(url_radarr_api_movies, timeout=60, verify=False)
|
||||||
except requests.exceptions.ConnectionError as errc:
|
except requests.exceptions.ConnectionError as errc:
|
||||||
|
@ -290,7 +297,7 @@ def get_profile_list():
|
||||||
if radarr_version.startswith('0'):
|
if radarr_version.startswith('0'):
|
||||||
for profile in profiles_json.json():
|
for profile in profiles_json.json():
|
||||||
profiles_list.append([profile['id'], profile['language'].capitalize()])
|
profiles_list.append([profile['id'], profile['language'].capitalize()])
|
||||||
elif radarr_version.startswith('2'):
|
else:
|
||||||
for profile in profiles_json.json():
|
for profile in profiles_json.json():
|
||||||
profiles_list.append([profile['id'], profile['language']['name'].capitalize()])
|
profiles_list.append([profile['id'], profile['language']['name'].capitalize()])
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue