Error 500 in episode list

pull/26/head
Louis Vézina 7 years ago
parent a83e3d4f65
commit 31a14eea7c

@ -1,4 +1,4 @@
FROM lsiobase/alpine.python FROM python:2
EXPOSE 6767 EXPOSE 6767

@ -120,4 +120,7 @@ def add_new_episodes():
# Store substitles from episodes we've just added # Store substitles from episodes we've just added
new_scan_subtitles() new_scan_subtitles()
list_missing_subtitles() try:
list_missing_subtitles()
except:
pass

@ -155,36 +155,43 @@
%if episode[4] is not None: %if episode[4] is not None:
% actual_languages = ast.literal_eval(episode[4]) % actual_languages = ast.literal_eval(episode[4])
%else: %else:
actual_languages = '[]' % actual_languages = '[]'
%end %end
%if actual_languages is not None:
%try:
%for language in actual_languages: %for language in actual_languages:
%if language[1] is not None: %if language[1] is not None:
<a data-episodePath="{{episode[1]}}" data-subtitlesPath="{{path_replace(language[1])}}" data-language="{{pycountry.languages.lookup(str(language[0])).alpha_3}}" data-sonarrSeriesId={{episode[5]}} data-sonarrEpisodeId={{episode[7]}} class="remove_subtitles ui tiny label"> <a data-episodePath="{{episode[1]}}" data-subtitlesPath="{{path_replace(language[1])}}" data-language="{{pycountry.languages.lookup(str(language[0])).alpha_3}}" data-sonarrSeriesId={{episode[5]}} data-sonarrEpisodeId={{episode[7]}} class="remove_subtitles ui tiny label">
{{language[0]}} {{language[0]}}
<i class="delete icon"></i> <i class="delete icon"></i>
</a> </a>
%else: %else:
<div class="ui tiny label"> <div class="ui tiny label">
{{language[0]}} {{language[0]}}
</div> </div>
%end %end
%end %end
%except:
%pass
%end %end
</td> </td>
<td> <td>
%if episode[6] is not None: %try:
% missing_languages = ast.literal_eval(episode[6]) %if episode[6] is not None:
%else: % missing_languages = ast.literal_eval(episode[6])
% missing_languages = None %else:
%end % missing_languages = None
%if missing_languages is not None: %end
%for language in missing_languages: %if missing_languages is not None:
<a data-episodePath="{{episode[1]}}" data-language="{{pycountry.languages.lookup(str(language)).alpha_3}}" data-hi="{{details[4]}}" data-sonarrSeriesId={{episode[5]}} data-sonarrEpisodeId={{episode[7]}} class="get_subtitle ui tiny label"> %for language in missing_languages:
{{language}} <a data-episodePath="{{episode[1]}}" data-language="{{pycountry.languages.lookup(str(language)).alpha_3}}" data-hi="{{details[4]}}" data-sonarrSeriesId={{episode[5]}} data-sonarrEpisodeId={{episode[7]}} class="get_subtitle ui tiny label">
<i style="margin-left:3px; margin-right:0px" class="search icon"></i> {{language}}
</a> <i style="margin-left:3px; margin-right:0px" class="search icon"></i>
</a>
%end
%end %end
%except:
%pass
%end %end
</td> </td>
</tr> </tr>

Loading…
Cancel
Save