utility.presence: fix equal timestamps for bar
This commit is contained in:
parent
b5fac022bd
commit
0a3213cae9
1 changed files with 4 additions and 1 deletions
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue