+++ /dev/null
-<html>
-<meta charset="UTF-8">
-<body>
-<p><a href="/playlist">playlist</a> · <a href="/videos">videos</a> · <a href="/queries">queries</a></p>
-<table>
-<tr><th>title:</th><td>{{video_data.title}}</td></tr>
-<tr><th>thumbnail:</th><td><img src="/thumbnails/{{video_data.id_}}.jpg" /></td></tr>
-<tr><th>description:</th><td>{{video_data.description}}</td></tr>
-<tr><th>duration:</th><td>{{video_data.duration}}</td></tr>
-<tr><th>definition:</th><td>{{video_data.definition}}</td></tr>
-<tr><th>YouTube ID:</th><td>{{video_data.id_}} (<a href="{{youtube_prefix}}{{video_data.id_}}">watch</a>)</td></tr>
-<tr><th>download:</th><td>{% if is_temp %}working on it{% else %}<a href="/dl/{{video_data.id_}}">{{ file_path if file_path else "please do" }}</a>{% endif %}</td></tr>
-<tr>
-<th>linked queries:</th>
-<td>
-<ul>
-{% for query in queries %}<li><a href="/query/{{query.id_}}">{{query.text}}</a>{% endfor %}
-</ul>
-</td>
-</tr>
-</table>
-</body>
-</html>
-
--- /dev/null
+<html>
+<meta charset="UTF-8">
+<body>
+<p><a href="/playlist">playlist</a> · <a href="/videos">videos</a> · <a href="/queries">queries</a></p>
+<table>
+<tr><th>title:</th><td>{{video_data.title}}</td></tr>
+<tr><th>thumbnail:</th><td><img src="/thumbnails/{{video_data.id_}}.jpg" /></td></tr>
+<tr><th>description:</th><td>{{video_data.description}}</td></tr>
+<tr><th>duration:</th><td>{{video_data.duration}}</td></tr>
+<tr><th>definition:</th><td>{{video_data.definition}}</td></tr>
+<tr><th>YouTube ID:</th><td>{{video_data.id_}} (<a href="{{youtube_prefix}}{{video_data.id_}}">watch</a>)</td></tr>
+<tr><th>download:</th><td>{% if is_temp %}working on it{% else %}<a href="/dl/{{video_data.id_}}">{{ file_path if file_path else "please do" }}</a>{% endif %}</td></tr>
+<tr>
+<th>linked queries:</th>
+<td>
+<ul>
+{% for query in queries %}<li><a href="/query/{{query.id_}}">{{query.text}}</a>{% endfor %}
+</ul>
+</td>
+</tr>
+</table>
+</body>
+</html>
+
NAME_TEMPLATE_QUERIES = PathStr('queries.tmpl')
NAME_TEMPLATE_RESULTS = PathStr('results.tmpl')
NAME_TEMPLATE_VIDEOS = PathStr('videos.tmpl')
-NAME_TEMPLATE_VIDEO_ABOUT = PathStr('video_about.tmpl')
+NAME_TEMPLATE_YT_VIDEO = PathStr('yt_video.tmpl')
NAME_TEMPLATE_PLAYLIST = PathStr('playlist.tmpl')
PATH_TEMPLATE_QUERIES = PathStr(path_join(PATH_TEMPLATES,
NAME_TEMPLATE_QUERIES))
self._send_or_download_video(YoutubeId(toks_url[2]))
elif 'videos' == page_name:
self._send_videos_index()
- elif 'video_about' == page_name:
- self._send_video_about(YoutubeId(toks_url[2]))
+ elif 'yt_video' == page_name:
+ self._send_yt_video_data(YoutubeId(toks_url[2]))
elif 'missing.json' == page_name:
self._send_missing_json()
elif 'query' == page_name:
self._send_http(content=video)
return
self.server.downloads.queue_download(video_id)
- self._send_http(headers=[('Location', f'/video_about/{video_id}')],
+ self._send_http(headers=[('Location', f'/yt_video/{video_id}')],
code=302)
def _send_query_page(self, query_id: QueryId) -> None:
NAME_TEMPLATE_QUERIES, {'queries': queries_data,
'quota_count': quota_count})
- def _send_video_about(self, video_id: YoutubeId) -> None:
+ def _send_yt_video_data(self, video_id: YoutubeId) -> None:
conn = DatabaseConnection()
linked_queries = YoutubeQuery.get_all_for_video(conn, video_id)
try:
video_data = YoutubeVideo(video_id)
conn.commit_close()
self._send_rendered_template(
- NAME_TEMPLATE_VIDEO_ABOUT,
+ NAME_TEMPLATE_YT_VIDEO,
{'video_data': video_data,
'is_temp': video_id in self.server.downloads.ids_unfinished,
'file_path': self.server.downloads.ids_to_paths.get(video_id,