fix queue when only one video

This commit is contained in:
insert 2024-12-01 17:16:12 -05:00
parent c94404fee5
commit d0b976f784
Signed by: insert
GPG key ID: A70775C389ACF105

View file

@ -311,7 +311,10 @@ async def getqueue(inter: disnake.AppCmdInter):
await inter.edit_original_response("There are no items in queue")
return
message = f"Now Playing: <{queue[0]}>\n"
message = message + f"Up Next: <{queue[1]}>\n"
try:
message = message + f"Up Next: <{queue[1]}>\n"
except IndexError:
pass
message = message + f"Shuffle is currently " + ("off\n" if not shuffle else "on!\n")
res = cur.execute(f"SELECT link FROM queue WHERE hasplayed = false")
links = [x[0] for x in res.fetchall()]
@ -339,7 +342,10 @@ async def button_listener(inter: disnake.MessageInteraction):
page = page[-1].split(" of ")
if inter.component.custom_id == "Forward":
message = f"Now Playing: <{queue[0]}>\n"
message = message + f"Up Next: <{queue[1]}>\n"
try:
message = message + f"Up Next: <{queue[1]}>\n"
except IndexError:
pass
message = message + f"Shuffle is currently " + ("off\n" if not shuffle else "on!\n")
res = cur.execute(f"SELECT link FROM queue WHERE hasplayed = false")
links = [x[0] for x in res.fetchall()]
@ -361,7 +367,10 @@ async def button_listener(inter: disnake.MessageInteraction):
return
if inter.component.custom_id == "Backward":
message = f"Now Playing: <{queue[0]}>\n"
message = message + f"Up Next: <{queue[1]}>\n"
try:
message = message + f"Up Next: <{queue[1]}>\n"
except IndexError:
pass
message = message + f"Shuffle is currently " + ("off\n" if not shuffle else "on!\n")
res = cur.execute(f"SELECT link FROM queue WHERE hasplayed = false")
links = [x[0] for x in res.fetchall()]