pull/249/head
Halali 6 years ago
parent c20236141f
commit e1b9f0dd8d

@ -693,7 +693,7 @@ def episodes(no):
series_details = c.execute("SELECT title, overview, poster, fanart, hearing_impaired, tvdbid, audio_language, languages, path_substitution(path) FROM table_shows WHERE sonarrSeriesId LIKE ?", (str(no),)).fetchone()
tvdbid = series_details[5]
episodes = c.execute("SELECT title, path_substitution(path), season, episode, subtitles, sonarrSeriesId, missing_subtitles, sonarrEpisodeId, scene_name, monitored, failedAttempts FROM table_episodes WHERE sonarrSeriesId LIKE ? ORDER BY episode ASC", (str(no),)).fetchall()
episodes = c.execute("SELECT title, path_substitution(path), season, episode, subtitles, sonarrSeriesId, missing_subtitles, sonarrEpisodeId, scene_name, monitored FROM table_episodes WHERE sonarrSeriesId LIKE ? ORDER BY episode ASC", (str(no),)).fetchall()
number = len(episodes)
languages = c.execute("SELECT code2, name FROM table_settings_languages WHERE enabled = 1").fetchall()
c.close()

@ -214,26 +214,27 @@
</td>
<td>
%try:
%if episode[6] is not None:
% missing_languages = ast.literal_eval(episode[6])
% missing_languages.sort()
%else:
% missing_languages = None
%end
%if missing_languages is not None:
%from get_subtitle import search_active
%from get_settings import get_general_settings
%for language in missing_languages:
%if episode[10] is not None and get_general_settings()[25]:
%for lang in ast.literal_eval(episode[10]):
%if language in lang:
%active = search_active(lang[1])
%if active:
<%
if episode[6] is not None:
missing_languages = ast.literal_eval(episode[6])
missing_languages.sort()
else:
missing_languages = None
end
if missing_languages is not None:
from get_subtitle import search_active
from get_settings import get_general_settings
for language in missing_languages:
if episode[10] is not None and get_general_settings()[25]:
for lang in ast.literal_eval(episode[10]):
if language in lang:
if search_active(lang[1]):
%>
<a data-episodePath="{{episode[1]}}" data-scenename="{{episode[8]}}" data-language="{{alpha3_from_alpha2(str(language))}}" data-hi="{{details[4]}}" data-sonarrSeriesId="{{episode[5]}}" data-sonarrEpisodeId="{{episode[7]}}" class="get_subtitle ui tiny label">
{{language}}
<i style="margin-left:3px; margin-right:0px" class="search icon"></i>
%else:
<a data-tooltip="Excluded from automatic search" data-position="top right" data-inverted="" data-episodePath="{{episode[1]}}" data-scenename="{{episode[8]}}" data-language="{{alpha3_from_alpha2(str(language))}}" data-hi="{{details[4]}}" data-sonarrSeriesId="{{episode[5]}}" data-sonarrEpisodeId="{{episode[7]}}" class="get_subtitle ui tiny label">
<a data-tooltip="Automatic searching delayed (adaptive search)" data-position="top right" data-inverted="" data-episodePath="{{episode[1]}}" data-scenename="{{episode[8]}}" data-language="{{alpha3_from_alpha2(str(language))}}" data-hi="{{details[4]}}" data-sonarrSeriesId="{{episode[5]}}" data-sonarrEpisodeId="{{episode[7]}}" class="get_subtitle ui tiny label">
{{language}}
<i style="margin-left:3px; margin-right:0px" class="search red icon"></i>
%end

@ -76,23 +76,27 @@
</td>
<td>{{row[2]}}</td>
<td>
%missing_languages = ast.literal_eval(row[3])
%if missing_languages is not None:
%from get_subtitle import search_active
%from get_settings import get_general_settings
%for language in missing_languages:
%if row[9] is not None and get_general_settings()[25]:
%for lang in ast.literal_eval(row[9]):
%if language in lang:
%active = search_active(lang[1])
%if active:
<%
missing_languages = ast.literal_eval(row[3])
if missing_languages is not None:
from get_subtitle import search_active
from get_settings import get_general_settings
for language in missing_languages:
if row[9] is not None and get_general_settings()[25]:
for lang in ast.literal_eval(row[9]):
if language in lang:
active = search_active(lang[1])
if active:
%>
<a data-episodePath="{{row[5]}}" data-sceneName="{{row[8]}}" data-language="{{alpha3_from_alpha2(str(language))}}" data-hi="{{row[6]}}" data-sonarrSeriesId={{row[4]}} data-sonarrEpisodeId={{row[7]}} class="get_subtitle ui tiny label">
{{language}}
<i style="margin-left:3px; margin-right:0px" class="search icon"></i>
</a>
%else:
<a data-episodePath="{{row[5]}}" data-sceneName="{{row[8]}}" data-language="{{alpha3_from_alpha2(str(language))}}" data-hi="{{row[6]}}" data-sonarrSeriesId={{row[4]}} data-sonarrEpisodeId={{row[7]}} class="get_subtitle ui tiny label">
<a data-tooltip="Automatic searching delayed (adaptive search)" data-position="top right" data-inverted="" data-episodePath="{{row[5]}}" data-sceneName="{{row[8]}}" data-language="{{alpha3_from_alpha2(str(language))}}" data-hi="{{row[6]}}" data-sonarrSeriesId={{row[4]}} data-sonarrEpisodeId={{row[7]}} class="get_subtitle ui tiny label">
{{language}}
<i style="margin-left:3px; margin-right:0px" class="search red icon"></i>
</a>
%end
%end
%end
@ -100,6 +104,7 @@
<a data-episodePath="{{row[5]}}" data-sceneName="{{row[8]}}" data-language="{{alpha3_from_alpha2(str(language))}}" data-hi="{{row[6]}}" data-sonarrSeriesId={{row[4]}} data-sonarrEpisodeId={{row[7]}} class="get_subtitle ui tiny label">
{{language}}
<i style="margin-left:3px; margin-right:0px" class="search icon"></i>
</a>
%end
%end

Loading…
Cancel
Save