diff --git a/index.js b/index.js index e8e6cda..c35bc3e 100644 --- a/index.js +++ b/index.js @@ -115,6 +115,20 @@ function pageUpdate() { } } } + function songStats() { + var html = `` + + if (activity.assets && activity.assets.large_text != activity.details) { + html += ` +
Album: ${activity.assets.large_text || " "} +
Artist: ${activity.state || " "} + ` + } else { + html += `
Artist: ${activity.state || " "}` + } + + return html + } if (activity.type == 2) { if (get_img()) { addedHTML += ` @@ -122,22 +136,11 @@ function pageUpdate() {

Listening to ${activity.name} -
Song: ${activity.details} -
Album: ${activity.assets.large_text} -
Artist: ${activity.state} +
Song: ${activity.details || " "} + ${songStats()}

` - } else { - addedHTML += ` -
-

- Playing ${activity.name} -
${activity.state} -
${activity.details} -

-
- ` } } else if (activity.type == 0) { if (get_img()) { @@ -146,23 +149,14 @@ function pageUpdate() {

Playing ${activity.name} -
${activity.details || activity.assets.large_text} -
${activity.state || activity.assets.small_text} +
${activity.details || activity.assets.large_text || " "} +
${activity.state || activity.assets.small_text || " "} +
${Math.floor(((Date.now() - activity.timestamps.start) / 1000 / 60)).toString() + " Minutes" || " "}

` - } else { - addedHTML += ` -
-

- Playing ${activity.name} -
${activity.state} -
${activity.details} -

-
- ` - } + } } } }