aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLouis Vézina <[email protected]>2019-11-15 06:51:59 -0500
committerLouis Vézina <[email protected]>2019-11-15 06:51:59 -0500
commite0aac7de4a46272652560e82b5ceeb8f267ef0d2 (patch)
tree32e38be10a5bee8f1884fda3ed4b34ff53768d09
parent8ad2e46dd37f4cc10690b6cc45f32235aea174e4 (diff)
downloadbazarr-e0aac7de4a46272652560e82b5ceeb8f267ef0d2.tar.gz
bazarr-e0aac7de4a46272652560e82b5ceeb8f267ef0d2.zip
Fix for episodes and movies subtitles sorting when detected language is None.
-rw-r--r--views/episodes.tpl2
-rw-r--r--views/movie.tpl2
2 files changed, 2 insertions, 2 deletions
diff --git a/views/episodes.tpl b/views/episodes.tpl
index e0aaf4fbd..949788a39 100644
--- a/views/episodes.tpl
+++ b/views/episodes.tpl
@@ -222,7 +222,7 @@
<td>
%if episode['subtitles'] is not None:
% actual_languages = ast.literal_eval(episode['subtitles'])
- % actual_languages.sort()
+ % actual_languages = sorted(actual_languages, key=lambda x: (x is None, x))
%else:
% actual_languages = '[]'
%end
diff --git a/views/movie.tpl b/views/movie.tpl
index bca765709..21038aa81 100644
--- a/views/movie.tpl
+++ b/views/movie.tpl
@@ -171,7 +171,7 @@
<tbody>
<%
subtitles_files = ast.literal_eval(str(details['subtitles']))
- subtitles_files.sort()
+ subtitles_files = sorted(subtitles_files, key=lambda x: (x is None, x))
if subtitles_files is not None:
for subtitles_file in subtitles_files:
if subtitles_file[0].endswith(':forced'):