Add tooltips for scenename, filename and adaptive searching in episode and wanted episode

pull/249/head
Halali 6 years ago
parent c9a14c2c02
commit 675bacc78d

@ -690,7 +690,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 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, failedAttempts 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()
@ -986,7 +986,7 @@ def wantedseries():
offset = (int(page) - 1) * page_size
max_page = int(math.ceil(missing_count / (page_size + 0.0)))
c.execute("SELECT table_shows.title, table_episodes.season || 'x' || table_episodes.episode, table_episodes.title, table_episodes.missing_subtitles, table_episodes.sonarrSeriesId, path_substitution(table_episodes.path), table_shows.hearing_impaired, table_episodes.sonarrEpisodeId, table_episodes.scene_name FROM table_episodes INNER JOIN table_shows on table_shows.sonarrSeriesId = table_episodes.sonarrSeriesId WHERE table_episodes.missing_subtitles != '[]'" + monitored_only_query_string + " ORDER BY table_episodes._rowid_ DESC LIMIT ? OFFSET ?", (page_size, offset,))
c.execute("SELECT table_shows.title, table_episodes.season || 'x' || table_episodes.episode, table_episodes.title, table_episodes.missing_subtitles, table_episodes.sonarrSeriesId, path_substitution(table_episodes.path), table_shows.hearing_impaired, table_episodes.sonarrEpisodeId, table_episodes.scene_name, table_episodes.failedAttempts FROM table_episodes INNER JOIN table_shows on table_shows.sonarrSeriesId = table_episodes.sonarrSeriesId WHERE table_episodes.missing_subtitles != '[]'" + monitored_only_query_string + " ORDER BY table_episodes._rowid_ DESC LIMIT ? OFFSET ?", (page_size, offset,))
data = c.fetchall()
c.close()
return template('wantedseries', __file__=__file__, bazarr_version=bazarr_version, rows=data, missing_count=missing_count, page=page, max_page=max_page, base_url=base_url, page_size=page_size, current_port=port)

@ -51,7 +51,7 @@
padding-left: 2em;
padding-right: 2em;
padding-bottom: 1em;
overflow-x:auto;
overflow-x: auto;
}
.ui.basic.button:hover, .ui.basic.buttons .button:hover {
background: transparent !important;
@ -165,6 +165,7 @@
<tr>
<th class="collapsing"></th>
<th class="collapsing">Episode</th>
<th class="collapsing"></th>
<th>Title</th>
<th class="collapsing">Existing<br>subtitles</th>
<th class="collapsing">Missing<br>subtitles</th>
@ -182,7 +183,12 @@
%end
</td>
<td>{{episode[3]}}</td>
<td>{{episode[0]}}</td>
<td>
% if episode[8] is not None:
<span data-tooltip="{{episode[8]}}"><i class="info circle icon"></i></span>
% end
</td>
<td><span data-tooltip="{{episode[1]}}">{{episode[0]}}</span></td>
<td>
%if episode[4] is not None:
% actual_languages = ast.literal_eval(episode[4])
@ -208,7 +214,7 @@
%end
</td>
<td>
%try:
%try:
%if episode[6] is not None:
% missing_languages = ast.literal_eval(episode[6])
% missing_languages.sort()
@ -216,15 +222,34 @@
% 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:
<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>
%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:
<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="Exclude from automatic search" 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
%end
%end
%else:
<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>
%end
</a>
%end
%end
%end
%except:
%pass
%except:
%pass
%end
</td>
<td>

@ -78,11 +78,30 @@
<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:
<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>
%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>
%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">
{{language}}
<i style="margin-left:3px; margin-right:0px" class="search red icon"></i>
%end
%end
%end
%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">
{{language}}
<i style="margin-left:3px; margin-right:0px" class="search icon"></i>
%end
%end
%end
</td>

Loading…
Cancel
Save