don't always display the first element of the list as the now playing item
All checks were successful
ci/woodpecker/push/publish Pipeline was successful

This commit is contained in:
Mylloon 2023-03-18 19:40:42 +01:00
parent 5a9e3863a1
commit cb22b1de75
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -25,8 +25,9 @@ export const embedListQueue = (
embed.setFooter({ text: `${printRepeatMode(queue.repeatMode, loc)}` }); embed.setFooter({ text: `${printRepeatMode(queue.repeatMode, loc)}` });
tracks.slice((page - 1) * limit_fields, page * limit_fields).forEach((t, idx) => { 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 now_playing = idx == 0 && page == 1;
const idx_track = idx == 0 ? "" : `${idx + limit_fields * (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({ embed.addFields({
name, name,
value: `${idx_track}[${t.title}${t.author}](${t.url}) (${t.duration})`, value: `${idx_track}[${t.title}${t.author}](${t.url}) (${t.duration})`,