From 2fe8936e850b41941bb8b277b9c5aa217c735cd4 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 15 Nov 2021 13:00:17 +0700 Subject: [PATCH] add playlist position index --- tubearchivist/home/src/index.py | 1 + tubearchivist/home/templates/home/video.html | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tubearchivist/home/src/index.py b/tubearchivist/home/src/index.py index 205ad507..49a7d23d 100644 --- a/tubearchivist/home/src/index.py +++ b/tubearchivist/home/src/index.py @@ -602,6 +602,7 @@ class YoutubePlaylist: nav = { "playlist_meta": { + "current_idx": current_idx, "playlist_id": self.playlist_id, "playlist_name": self.playlist_dict["playlist_name"], "playlist_channel": self.playlist_dict["playlist_channel"], diff --git a/tubearchivist/home/templates/home/video.html b/tubearchivist/home/templates/home/video.html index c8aa419a..884c1b6f 100644 --- a/tubearchivist/home/templates/home/video.html +++ b/tubearchivist/home/templates/home/video.html @@ -76,7 +76,7 @@ {% for playlist_item in playlist_nav %}
-

Playlist: {{ playlist_item.playlist_meta.playlist_name }}

+

Playlist [{{ playlist_item.playlist_meta.current_idx|add:"1" }}]: {{ playlist_item.playlist_meta.playlist_name }}