utility.presence: fix equal timestamps for bar

This commit is contained in:
Cynthia Foxwell 2022-10-10 13:26:03 -06:00
parent b5fac022bd
commit 0a3213cae9

View file

@ -770,7 +770,10 @@ presence.callback = async function (msg, line) {
const timeEnd = formatTime(length); const timeEnd = formatTime(length);
const timePos = formatTime(position); const timePos = formatTime(position);
const progress = position / length; const progress =
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(