<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_}}</td></tr>
-<tr>
-<th>actions:</th>
-<td>
-<ul>
-<li><a href="{{youtube_prefix}}{{video_data.id_}}">watch on YouTube</a>
-<li><a href="/dl/{{video_data.id_}}">{% if available %}watch locally{% else %}download{% endif %}</a>
-</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><a href="/dl/{{video_data.id_}}">{{ file_path if file_path else "please do" }}</a></td></tr>
<tr>
<th>linked queries:</th>
<td>
PlayerUpdateId = NewType('PlayerUpdateId', str)
DownloadsDb: TypeAlias = dict[VideoId, PathStr]
TemplateContext: TypeAlias = dict[
- str, None | bool | PlayerUpdateId | PathStr | VideoId | QueryText
- | QuotaCost | 'VideoData' | list['VideoData'] | list['QueryData']
- | list[tuple[VideoId, PathStr]] | list[tuple[PathStr, PathStr]]]
+ str, None | bool | PlayerUpdateId | Optional[PathStr] | VideoId
+ | QueryText | QuotaCost | 'VideoData' | list['VideoData']
+ | list['QueryData'] | list[tuple[VideoId, PathStr]]
+ | list[tuple[PathStr, PathStr]]]
class NotFoundException(BaseException):
'quota_count': quota_count})
def _send_video_about(self, video_id: VideoId) -> None:
- downloads_db = self._make_downloads_db()
conn = DatabaseConnection()
linked_queries = QueryData.get_all_for_video(conn, video_id)
try:
self._send_rendered_template(
NAME_TEMPLATE_VIDEO_ABOUT,
{'video_data': video_data,
- 'available': video_data.id_ in downloads_db,
+ 'file_path': self._make_downloads_db().get(video_id, None),
'youtube_prefix': YOUTUBE_URL_PREFIX,
'queries': linked_queries})