From: Christian Heller Date: Sat, 23 Nov 2024 05:33:29 +0000 (+0100) Subject: Change "video_about" namens into "yt_video" or variation thereof. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/%7B%7Bprefix%7D%7D/bar%20baz.html?a=commitdiff_plain;h=4e25ace0cfcb49ed40cc921ae5030660b40ef975;p=ytplom Change "video_about" namens into "yt_video" or variation thereof. --- diff --git a/templates/results.tmpl b/templates/results.tmpl index 124704a..db9d9a5 100644 --- a/templates/results.tmpl +++ b/templates/results.tmpl @@ -7,14 +7,14 @@ {% for video in videos %} - + {{video.definition}}
{{video.duration}} -{{video.title}} · {{video.description}} +{{video.title}} · {{video.description}} {% endfor %} diff --git a/templates/video_about.tmpl b/templates/video_about.tmpl deleted file mode 100644 index 358cced..0000000 --- a/templates/video_about.tmpl +++ /dev/null @@ -1,24 +0,0 @@ - - - -

playlist · videos · queries

- - - - - - - - - - - - -
title:{{video_data.title}}
thumbnail:
description:{{video_data.description}}
duration:{{video_data.duration}}
definition:{{video_data.definition}}
YouTube ID:{{video_data.id_}} (watch)
download:{% if is_temp %}working on it{% else %}{{ file_path if file_path else "please do" }}{% endif %}
linked queries: - -
- - - diff --git a/templates/videos.tmpl b/templates/videos.tmpl index daba8ed..3fb3648 100644 --- a/templates/videos.tmpl +++ b/templates/videos.tmpl @@ -5,7 +5,7 @@

downloaded videos:

diff --git a/templates/yt_video.tmpl b/templates/yt_video.tmpl new file mode 100644 index 0000000..358cced --- /dev/null +++ b/templates/yt_video.tmpl @@ -0,0 +1,24 @@ + + + +

playlist · videos · queries

+ + + + + + + + + + + + +
title:{{video_data.title}}
thumbnail:
description:{{video_data.description}}
duration:{{video_data.duration}}
definition:{{video_data.definition}}
YouTube ID:{{video_data.id_}} (watch)
download:{% if is_temp %}working on it{% else %}{{ file_path if file_path else "please do" }}{% endif %}
linked queries: + +
+ + + diff --git a/ytplom/misc.py b/ytplom/misc.py index 579c3ce..4d06781 100644 --- a/ytplom/misc.py +++ b/ytplom/misc.py @@ -56,7 +56,7 @@ PATH_TEMPLATES = PathStr(path_join(PATH_WORKDIR, 'templates')) 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)) @@ -663,8 +663,8 @@ class TaskHandler(BaseHTTPRequestHandler): 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: @@ -713,7 +713,7 @@ class TaskHandler(BaseHTTPRequestHandler): 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: @@ -735,7 +735,7 @@ class TaskHandler(BaseHTTPRequestHandler): 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: @@ -744,7 +744,7 @@ class TaskHandler(BaseHTTPRequestHandler): 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,