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
1 changed files with 4 additions and 1 deletions

View File

@ -770,7 +770,10 @@ presence.callback = async function (msg, line) {
const timeEnd = formatTime(length);
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 bar = `\`[${"=".repeat(barLength)}${" ".repeat(