From 4e25ace0cfcb49ed40cc921ae5030660b40ef975 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sat, 23 Nov 2024 06:33:29 +0100 Subject: [PATCH] Change "video_about" namens into "yt_video" or variation thereof. --- templates/results.tmpl | 4 ++-- templates/videos.tmpl | 2 +- templates/{video_about.tmpl => yt_video.tmpl} | 0 ytplom/misc.py | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) rename templates/{video_about.tmpl => yt_video.tmpl} (100%) 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/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/video_about.tmpl b/templates/yt_video.tmpl similarity index 100% rename from templates/video_about.tmpl rename to templates/yt_video.tmpl 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, -- 2.30.2