utility.presence: spotify parity on state and album

This commit is contained in:
Cynthia Foxwell 2024-06-14 23:35:03 -06:00
parent 4173371c11
commit b9d2d4c5d6

View file

@ -1706,9 +1706,16 @@ presence.callback = async function (msg, line) {
} }
descLines.push(`**${details}**`); descLines.push(`**${details}**`);
} }
if (activity.state) descLines.push(activity.state); if (activity.state) {
let stateLine = activity.state;
if (activity.name == "Spotify")
stateLine = "by " + stateLine.split("; ").join(", ");
descLines.push(stateLine);
}
if (activity.assets?.large_text) { if (activity.assets?.large_text) {
let albumLine = activity.assets.large_text; let albumLine = activity.assets.large_text;
if (activity.name == "Spotify") albumLine = "on " + albumLine;
if (activity.party?.size) { if (activity.party?.size) {
albumLine += ` (${activity.party.size[0]} of ${activity.party.size[1]})`; albumLine += ` (${activity.party.size[0]} of ${activity.party.size[1]})`;
} }