Update discordrpc.ts
This commit is contained in:
parent
39afd6c990
commit
3cd8a6dae2
1 changed files with 3 additions and 10 deletions
|
@ -102,15 +102,8 @@ export default class DiscordRichPresence {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const listenURL = `https://cider.sh/p?s&id=${attributes.playParams.id}` // cider://play/s/[id] (for song)
|
const listenURL = `https://cider.sh/p?s&id=${attributes.playParams.id}` // cider://play/s/[id] (for song)
|
||||||
let AMWebURL = '';
|
const amURL = `https://music.apple.com/${attributes.storefrontId}/song/${attributes.playParams.catalogId || attributes.playParams.id}`;
|
||||||
if(attributes.playParams.catalogId == null){
|
console.log("DiscordRPC URL: ", amURL);
|
||||||
AMWebURL = `https://music.apple.com/${attributes.storefrontId}/song/${attributes.playParams.id}`
|
|
||||||
console.log("No Catalog ID");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
AMWebURL = `https://music.apple.com/${attributes.storefrontId}/song/${attributes.playParams.catalogId}`
|
|
||||||
}
|
|
||||||
console.log("DiscordRPC URL: ", AMWebURL);
|
|
||||||
this._activity = {
|
this._activity = {
|
||||||
details: attributes.name,
|
details: attributes.name,
|
||||||
state: `${attributes.artistName ? `by ${attributes.artistName}` : ''}`,
|
state: `${attributes.artistName ? `by ${attributes.artistName}` : ''}`,
|
||||||
|
@ -122,7 +115,7 @@ export default class DiscordRichPresence {
|
||||||
|
|
||||||
buttons: [
|
buttons: [
|
||||||
{label: "Listen on Cider", url: listenURL},
|
{label: "Listen on Cider", url: listenURL},
|
||||||
{label: "View on Web", url: AMWebURL},
|
{label: "View on Apple Music", url: amURL},
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue