From b0fda1d167f1b02fdb263a2ed28770287ae55e28 Mon Sep 17 00:00:00 2001 From: Anri Kennel Date: Sat, 18 Mar 2023 19:42:29 +0100 Subject: [PATCH] Fix first element of queue list (#88) Follow up of #85 Co-authored-by: Mylloon Reviewed-on: https://git.mylloon.fr/ConfrerieDuKassoulait/Botanique/pulls/88 --- src/utils/music.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/music.ts b/src/utils/music.ts index 921af58..4705253 100644 --- a/src/utils/music.ts +++ b/src/utils/music.ts @@ -25,8 +25,9 @@ export const embedListQueue = ( embed.setFooter({ text: `${printRepeatMode(queue.repeatMode, loc)}` }); tracks.slice((page - 1) * limit_fields, page * limit_fields).forEach((t, idx) => { - const name = idx == 0 ? loc.get("c_queue10") : idx == 1 ? loc.get("c_queue11") : "\u200b"; - const idx_track = idx == 0 ? "" : `${idx + limit_fields * (page - 1)}. `; + const now_playing = idx == 0 && page == 1; + const name = now_playing ? loc.get("c_queue10") : idx == 1 ? loc.get("c_queue11") : "\u200b"; + const idx_track = now_playing ? "" : `${idx + limit_fields * (page - 1)}. `; embed.addFields({ name, value: `${idx_track}[${t.title} • ${t.author}](${t.url}) (${t.duration})`,