fix prev and nex playlist order

This commit is contained in:
simon 2021-11-26 16:47:39 +07:00
parent 5d7a609285
commit 31515961e1
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

View File

@ -611,21 +611,21 @@ class YoutubePlaylist:
current_idx = all_entries.index(current[0]) current_idx = all_entries.index(current[0])
if current_idx == 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 previous_item = False
else: else:
previous_item = all_entries[current_idx + 1] previous_item = all_entries[current_idx - 1]
prev_thumb = ThumbManager().vid_thumb_path( prev_thumb = ThumbManager().vid_thumb_path(
previous_item["youtube_id"] previous_item["youtube_id"]
) )
previous_item["vid_thumb"] = prev_thumb 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 = { nav = {
"playlist_meta": { "playlist_meta": {
"current_idx": current[0]["idx"], "current_idx": current[0]["idx"],