From 9809b08da5afbd15b57fa15950d957246b224fd9 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sat, 18 Mar 2023 19:27:00 +0100 Subject: [PATCH 1/3] Fix music queue numerotation --- src/utils/music.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/music.ts b/src/utils/music.ts index 6f9d349..5b41d3e 100644 --- a/src/utils/music.ts +++ b/src/utils/music.ts @@ -26,7 +26,7 @@ export const embedListQueue = ( 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 * page}. `; + const idx_track = idx == 0 ? "" : `${idx + limit_fields * page}. `; embed.addFields({ name, value: `${idx_track}[${t.title} • ${t.author}](${t.url}) (${t.duration})`, -- 2.45.2 From d95f41ab061ee111e9b2ecc10ed49cc2d7f753db Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sat, 18 Mar 2023 19:30:22 +0100 Subject: [PATCH 2/3] Oups --- src/utils/music.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/music.ts b/src/utils/music.ts index 5b41d3e..921af58 100644 --- a/src/utils/music.ts +++ b/src/utils/music.ts @@ -26,7 +26,7 @@ export const embedListQueue = ( 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}. `; + const idx_track = idx == 0 ? "" : `${idx + limit_fields * (page - 1)}. `; embed.addFields({ name, value: `${idx_track}[${t.title} • ${t.author}](${t.url}) (${t.duration})`, -- 2.45.2 From cb22b1de7511cd4fb8e458acfdb0620bc28b9eea Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sat, 18 Mar 2023 19:40:42 +0100 Subject: [PATCH 3/3] don't always display the first element of the list as the now playing item --- 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})`, -- 2.45.2