aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLouis Vézina <[email protected]>2020-08-18 16:35:06 -0400
committerLouis Vézina <[email protected]>2020-08-18 16:35:06 -0400
commit5dbde75893e984b667c8e35f224bff48fd7825e9 (patch)
tree97035da33f8f1a5ce3ad5aa64ce6524ad5e42a2b
parentd6ce71b16f85a1c6d5ba61fdf0ac125647752f86 (diff)
downloadbazarr-5dbde75893e984b667c8e35f224bff48fd7825e9.tar.gz
bazarr-5dbde75893e984b667c8e35f224bff48fd7825e9.zip
Another attempt to fix audio languages for Radarr v3.
-rw-r--r--bazarr/get_movies.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bazarr/get_movies.py b/bazarr/get_movies.py
index ce730f9af..ff3505795 100644
--- a/bazarr/get_movies.py
+++ b/bazarr/get_movies.py
@@ -151,8 +151,11 @@ def update_movies():
audio_language = profile_id_to_language(movie['qualityProfileId'], audio_profiles)
else:
if 'languages' in movie['movieFile'] and len(movie['movieFile']['languages']):
- if 'name' in movie['movieFile']['languages'][0]:
- audio_language = movie['movieFile']['languages'][0]['name']
+ for item in movie['movieFile']['languages']:
+ if isinstance(item, dict):
+ if 'name' in item:
+ audio_language = item['name']
+ break
tags = [d['label'] for d in tagsDict if d['id'] in movie['tags']]