presence: modernize listening bar

This commit is contained in:
Cynthia Foxwell 2025-04-07 14:08:34 -06:00
parent fddf5047cd
commit b9292504dc
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -18,7 +18,7 @@ const HangStatusImages = {};
}
})();
const NOWPLAYING_BAR_LENGTH = 30;
const NOWPLAYING_BAR_LENGTH = 32;
function fixMediaProxyURL(url) {
if (url.includes("media.discordapp.net")) {
@ -193,10 +193,12 @@ presence.callback = async function (msg, line) {
const progress = position >= length ? 1 : position / length;
const barLength = Math.round(progress * NOWPLAYING_BAR_LENGTH);
const bar = `\`[${"=".repeat(barLength)}${" ".repeat(NOWPLAYING_BAR_LENGTH - barLength)}]\``;
const time = `\`${timePos}${" ".repeat(
NOWPLAYING_BAR_LENGTH + 2 - timePos.length - timeEnd.length
)}${timeEnd}\``;
const bar = `\`\`\`ansi\n${"\u2014".repeat(barLength)}\x1b[30m${"\u2014".repeat(
NOWPLAYING_BAR_LENGTH - barLength
)}\x1b[39m`;
const time = `${timePos}${" ".repeat(
NOWPLAYING_BAR_LENGTH - timePos.length - timeEnd.length
)}${timeEnd}\`\`\``;
descLines.push(bar);
descLines.push(time);