From 31515961e1570dca1af6757ef8d839849669f659 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 26 Nov 2021 16:47:39 +0700 Subject: [PATCH] fix prev and nex playlist order --- tubearchivist/home/src/index.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tubearchivist/home/src/index.py b/tubearchivist/home/src/index.py index 78276ab..7185ce7 100644 --- a/tubearchivist/home/src/index.py +++ b/tubearchivist/home/src/index.py @@ -611,21 +611,21 @@ class YoutubePlaylist: current_idx = all_entries.index(current[0]) if current_idx == 0: - next_item = False - else: - next_item = all_entries[current_idx - 1] - next_thumb = ThumbManager().vid_thumb_path(next_item["youtube_id"]) - next_item["vid_thumb"] = next_thumb - - if current_idx == len(all_entries) - 1: previous_item = False else: - previous_item = all_entries[current_idx + 1] + previous_item = all_entries[current_idx - 1] prev_thumb = ThumbManager().vid_thumb_path( previous_item["youtube_id"] ) previous_item["vid_thumb"] = prev_thumb + if current_idx == len(all_entries) - 1: + next_item = False + else: + next_item = all_entries[current_idx + 1] + next_thumb = ThumbManager().vid_thumb_path(next_item["youtube_id"]) + next_item["vid_thumb"] = next_thumb + nav = { "playlist_meta": { "current_idx": current[0]["idx"],