Status fixes!
This commit is contained in:
parent
af851072b5
commit
89b0ee2ef7
1 changed files with 20 additions and 26 deletions
44
index.js
44
index.js
|
@ -115,6 +115,20 @@ function pageUpdate() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function songStats() {
|
||||||
|
var html = ``
|
||||||
|
|
||||||
|
if (activity.assets && activity.assets.large_text != activity.details) {
|
||||||
|
html += `
|
||||||
|
<br> Album: ${activity.assets.large_text || " "}
|
||||||
|
<br> Artist: ${activity.state || " "}
|
||||||
|
`
|
||||||
|
} else {
|
||||||
|
html += `<br> Artist: ${activity.state || " "}`
|
||||||
|
}
|
||||||
|
|
||||||
|
return html
|
||||||
|
}
|
||||||
if (activity.type == 2) {
|
if (activity.type == 2) {
|
||||||
if (get_img()) {
|
if (get_img()) {
|
||||||
addedHTML += `
|
addedHTML += `
|
||||||
|
@ -122,19 +136,8 @@ function pageUpdate() {
|
||||||
<img src="${get_img()}" title="${activity.assets.large_text || activity.assets.small_text}">
|
<img src="${get_img()}" title="${activity.assets.large_text || activity.assets.small_text}">
|
||||||
<p>
|
<p>
|
||||||
Listening to <span style="color: limegreen;">${activity.name}</span>
|
Listening to <span style="color: limegreen;">${activity.name}</span>
|
||||||
<br> Song: ${activity.details}
|
<br> Song: ${activity.details || " "}
|
||||||
<br> Album: ${activity.assets.large_text}
|
${songStats()}
|
||||||
<br> Artist: ${activity.state}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
`
|
|
||||||
} else {
|
|
||||||
addedHTML += `
|
|
||||||
<div class="chip activity col-md-6 testing">
|
|
||||||
<p style="width: 100%;">
|
|
||||||
Playing <span style="color: rgb(255, 100, 150);">${activity.name}</span>
|
|
||||||
<br> ${activity.state}
|
|
||||||
<br> ${activity.details}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
@ -146,22 +149,13 @@ function pageUpdate() {
|
||||||
<img src="${get_img()}" title="${activity.assets.large_text || activity.assets.small_text}">
|
<img src="${get_img()}" title="${activity.assets.large_text || activity.assets.small_text}">
|
||||||
<p>
|
<p>
|
||||||
Playing <span style="color: rgb(255, 100, 150);">${activity.name}</span>
|
Playing <span style="color: rgb(255, 100, 150);">${activity.name}</span>
|
||||||
<br> ${activity.details || activity.assets.large_text}
|
<br> ${activity.details || activity.assets.large_text || " "}
|
||||||
<br> ${activity.state || activity.assets.small_text}
|
<br> ${activity.state || activity.assets.small_text || " "}
|
||||||
|
<br> ${Math.floor(((Date.now() - activity.timestamps.start) / 1000 / 60)).toString() + " Minutes" || " "}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
} else {
|
|
||||||
addedHTML += `
|
|
||||||
<div class="chip activity col-md-6 testing">
|
|
||||||
<p>
|
|
||||||
Playing <span style="color: rgb(255, 100, 150);">${activity.name}</span>
|
|
||||||
<br> ${activity.state}
|
|
||||||
<br> ${activity.details}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
`
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue