From 70e1bcdbaa6635a824672ed362a552ac69e07b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Sat, 16 Nov 2019 08:44:14 -0500 Subject: [PATCH] Fix for embedded subtitles sorting under Python 3. --- views/episodes.tpl | 2 +- views/movie.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/views/episodes.tpl b/views/episodes.tpl index b18b2c3a2..7131826f3 100644 --- a/views/episodes.tpl +++ b/views/episodes.tpl @@ -222,7 +222,7 @@ %if episode['subtitles'] is not None: % actual_languages = ast.literal_eval(episode['subtitles']) - % actual_languages = sorted(actual_languages, key=lambda x: (x is None, x)) + % actual_languages.sort(key=lambda x: x[0]) %else: % actual_languages = '[]' %end diff --git a/views/movie.tpl b/views/movie.tpl index 21038aa81..10493dc5f 100644 --- a/views/movie.tpl +++ b/views/movie.tpl @@ -171,7 +171,7 @@ <% subtitles_files = ast.literal_eval(str(details['subtitles'])) - subtitles_files = sorted(subtitles_files, key=lambda x: (x is None, x)) + subtitles_files.sort(key=lambda x: x[0]) if subtitles_files is not None: for subtitles_file in subtitles_files: if subtitles_file[0].endswith(':forced'):