Fix for embedded subtitles sorting under Python 3.

This commit is contained in:
Louis Vézina 2019-11-16 08:44:14 -05:00
parent 684c8009bc
commit 70e1bcdbaa
2 changed files with 2 additions and 2 deletions

View File

@ -222,7 +222,7 @@
<td> <td>
%if episode['subtitles'] is not None: %if episode['subtitles'] is not None:
% actual_languages = ast.literal_eval(episode['subtitles']) % 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: %else:
% actual_languages = '[]' % actual_languages = '[]'
%end %end

View File

@ -171,7 +171,7 @@
<tbody> <tbody>
<% <%
subtitles_files = ast.literal_eval(str(details['subtitles'])) 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: if subtitles_files is not None:
for subtitles_file in subtitles_files: for subtitles_file in subtitles_files:
if subtitles_file[0].endswith(':forced'): if subtitles_file[0].endswith(':forced'):