utility.presence: use pos and length for deciding instead of timestamps

This commit is contained in:
Cynthia Foxwell 2023-08-24 16:53:33 -06:00
parent be4210bd26
commit 768e1982eb

View file

@ -963,10 +963,7 @@ presence.callback = async function (msg, line) {
const timeEnd = formatTime(length); const timeEnd = formatTime(length);
const timePos = formatTime(position); const timePos = formatTime(position);
const progress = const progress = position >= length ? 1 : position / length;
activity.timestamps.start >= activity.timestamps.end
? 1
: position / length;
const barLength = Math.round(progress * NOWPLAYING_BAR_LENGTH); const barLength = Math.round(progress * NOWPLAYING_BAR_LENGTH);
const bar = `\`[${"=".repeat(barLength)}${" ".repeat( const bar = `\`[${"=".repeat(barLength)}${" ".repeat(