From aaa2e0bd6644e5b12408299b789f8c6b737807c9 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Wed, 27 Nov 2024 00:37:43 +0100 Subject: [PATCH] Fix breakages due to previous unfinished commit. --- src/templates/_macros.tmpl | 6 +++--- src/templates/playlist.tmpl | 2 +- src/templates/queries.tmpl | 2 +- src/templates/results.tmpl | 4 ++-- src/templates/video.tmpl | 2 +- src/templates/videos.tmpl | 2 +- src/templates/yt_video.tmpl | 2 +- src/ytplom/misc.py | 18 +++++++++--------- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/templates/_macros.tmpl b/src/templates/_macros.tmpl index e11bc86..aa6ed50 100644 --- a/src/templates/_macros.tmpl +++ b/src/templates/_macros.tmpl @@ -1,13 +1,13 @@ -{% macro _link_if(cond, target) %}{% if cond %}{% endif %}{{target}}{% if cond %}{% endif %}{% endmacro %} +{% macro _link_if(cond, target, display_name = false ) %}{% if cond %}{% endif %}{% if display_name %}{{display_name}}{% else %}{{target}}{% endif %}{% if cond %}{% endif %}{% endmacro %} -{% macro nav_head(selected="") %} +{% macro nav_head(page_names, selected="") %}

{{ _link_if("playlist" != selected, page_names.playlist) }} · {{ _link_if("files" != selected, page_names.files) }} · -{{ _link_if("yt_queries" != selected, page_names.yt_queries) }} +{{ _link_if("yt_queries" != selected, page_names.yt_queries, "queries") }}


{% endmacro %} diff --git a/src/templates/playlist.tmpl b/src/templates/playlist.tmpl index 7625714..c1d084e 100644 --- a/src/templates/playlist.tmpl +++ b/src/templates/playlist.tmpl @@ -36,7 +36,7 @@ td.history { width: 50%; } {% block body %} -{{ macros.nav_head("playlist") }} +{{ macros.nav_head(page_names, "playlist") }}
{% if running %}{% if pause %}PAUSED{% else %}PLAYING{% endif %}{% else %}STOPPED{% endif %}:
diff --git a/src/templates/queries.tmpl b/src/templates/queries.tmpl index 8dae26d..9ef271d 100644 --- a/src/templates/queries.tmpl +++ b/src/templates/queries.tmpl @@ -2,7 +2,7 @@ {% block body %} -{{ macros.nav_head("yt_queries") }} +{{ macros.nav_head(page_names, "yt_queries") }}

quota: {{quota_count}}/100000

diff --git a/src/templates/results.tmpl b/src/templates/results.tmpl index 1998f7f..872d461 100644 --- a/src/templates/results.tmpl +++ b/src/templates/results.tmpl @@ -2,13 +2,13 @@ {% block body %} -{{ macros.nav_head() }} +{{ macros.nav_head(page_names) }}

query: {{query}}

{% for video in videos %}
- + {{video.definition}}
diff --git a/src/templates/video.tmpl b/src/templates/video.tmpl index 7de9b06..7ea70f9 100644 --- a/src/templates/video.tmpl +++ b/src/templates/video.tmpl @@ -2,7 +2,7 @@ {% block body %} -{{ macros.nav_head() }} +{{ macros.nav_head(page_names) }} diff --git a/src/templates/videos.tmpl b/src/templates/videos.tmpl index c49cf18..69543c8 100644 --- a/src/templates/videos.tmpl +++ b/src/templates/videos.tmpl @@ -2,7 +2,7 @@ {% block body %} -{{ macros.nav_head("files") }} +{{ macros.nav_head(page_names, "files") }}

downloaded videos:

    {% for video_id, path in videos %} diff --git a/src/templates/yt_video.tmpl b/src/templates/yt_video.tmpl index 3247741..73ffbab 100644 --- a/src/templates/yt_video.tmpl +++ b/src/templates/yt_video.tmpl @@ -2,7 +2,7 @@ {% block body %} -{{ macros.nav_head() }} +{{ macros.nav_head(page_names) }}
path:{{file.rel_path}}
YouTube ID:{{file.yt_id}}
diff --git a/src/ytplom/misc.py b/src/ytplom/misc.py index 48f475b..097c8c0 100644 --- a/src/ytplom/misc.py +++ b/src/ytplom/misc.py @@ -69,16 +69,16 @@ NAME_TEMPLATE_PLAYLIST = PathStr('playlist.tmpl') # page names PAGE_NAMES: PageNames = { - 'download': PathStr('dll'), - 'file': PathStr('fille'), - 'files': PathStr('filles'), + 'download': PathStr('dl'), + 'file': PathStr('file'), + 'files': PathStr('files'), 'last_update': PathStr('last_playlist_update.json'), - 'missing': PathStr('missing.jsoner'), - 'playlist': PathStr('playlisttt'), - 'thumbnails': PathStr('thumbnailz'), - 'yt_result': PathStr('ytt_video'), - 'yt_query': PathStr('ytt_query'), - 'yt_queries': PathStr('ytt_queries') + 'missing': PathStr('missing.json'), + 'playlist': PathStr('playlist'), + 'thumbnails': PathStr('thumbnails'), + 'yt_result': PathStr('yt_video'), + 'yt_query': PathStr('yt_query'), + 'yt_queries': PathStr('yt_queries') } # yt_dlp config -- 2.30.2
title:{{video_data.title}}
thumbnail: