From a3f32a8954a29b9c8f18742dba86d75748cca808 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Sun, 24 Apr 2022 11:41:19 -0600 Subject: [PATCH] music.queue: timestamps try 3 --- src/modules/music.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modules/music.js b/src/modules/music.js index e01a08d..59648f2 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -607,8 +607,7 @@ command.callback = async function (msg, line) { const nowPlaying = connection._music_nowplaying; const now = Date.now(); - let nextTrack = - now + (Math.floor(nowPlaying.length / 1000) - (now - nowPlaying.start)); + let nextTrack = now + (nowPlaying.length - (now - nowPlaying.start)); const fields = []; for (const index in queue.slice(0, 8)) { const item = queue[index]; @@ -616,10 +615,12 @@ command.callback = async function (msg, line) { name: item.title ?? item.url, value: `${item.title ? `[Link](${item.url}) - ` : ""}${formatTime( item.length - )}\nAdded by: <@${item.addedBy}>\n`, + )}\nAdded by: <@${item.addedBy}>\n`, inline: true, }); - nextTrack += Math.floor(item.length / 1000); + nextTrack += item.length; } return {