From 9b48b5986040a8ac50afd4bc9ac79eb5d54ba990 Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Sat, 15 Jan 2022 17:20:59 -0500 Subject: [PATCH] no log: added failsafe for compare str to None while trying to sort. --- bazarr/api/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bazarr/api/utils.py b/bazarr/api/utils.py index 61e19c947..5f5bb980f 100644 --- a/bazarr/api/utils.py +++ b/bazarr/api/utils.py @@ -199,7 +199,8 @@ def postprocessMovie(item): desired_lang_list = get_desired_languages(item['profileId']) 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')) + if item['subtitles']: + item['subtitles'] = sorted(item['subtitles'], key=itemgetter('name', 'forced')) # Parse missing subtitles if 'missing_subtitles' in item: