From 3e4a75aeca0c1d5fa70a35d8d878761592bb6d34 Mon Sep 17 00:00:00 2001 From: josdion Date: Sun, 31 May 2020 18:24:48 +0300 Subject: [PATCH] fix "Show Only Desired Languages" for movies without selected languages --- bazarr/api.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bazarr/api.py b/bazarr/api.py index ffddb5e49..438fdcdb5 100644 --- a/bazarr/api.py +++ b/bazarr/api.py @@ -719,8 +719,10 @@ class Movies(Resource): "forced": True if len(language) > 1 else False} if settings.general.getboolean('embedded_subs_show_desired'): - item['subtitles'] = [x for x in item['subtitles'] if - x['code2'] in [y['code2'] for y in item['languages']] or x['path']] + desired_lang_list = [] + if item['languages'] and item['languages'] != 'None': + desired_lang_list = [x['code2'] for x in item['languages']] + item['subtitles'] = [x for x in item['subtitles'] if x['code2'] in desired_lang_list or x['path']] item['subtitles'] = sorted(item['subtitles'], key=itemgetter('name', 'forced')) else: