utility.presence: use pos and length for deciding instead of timestamps
This commit is contained in:
parent
be4210bd26
commit
768e1982eb
1 changed files with 1 additions and 4 deletions
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue