Skip to content

Commit 45cb94b

Browse files
committed
fix: remove console log; Show artist fallback
1 parent 466bba6 commit 45cb94b

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

Extensions/webnowplaying.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@
1212
const info = {
1313
STATE: () => (Spicetify.Player.isPlaying() ? 1 : 2),
1414
TITLE: () => Spicetify.Player.data.track.metadata.title || "N/A",
15-
ARTIST: () =>
16-
document.querySelector("#view-player-footer .artist").innerText,
15+
ARTIST: () => {
16+
if (Spicetify.URI.isShow(Spicetify.Player.data.track.uri)) {
17+
return info.ALBUM();
18+
}
19+
20+
return document.querySelector("#view-player-footer .artist").innerText
21+
},
1722
ALBUM: () => Spicetify.Player.data.track.metadata.album_title || "N/A",
1823
DURATION: () => convertTimeToString(Spicetify.Player.getDuration()),
1924
POSITION: () => convertTimeToString(Spicetify.Player.getProgress()),
@@ -42,10 +47,8 @@
4247
if (!Spicetify.Player.data && currState !== 0) {
4348
ws.send("STATE:" + 0);
4449
currState = 0;
45-
console.log("State 0")
4650
return;
4751
}
48-
console.log("Updating")
4952
for (const field in info) {
5053
try {
5154
const data = info[field].call();
@@ -105,14 +108,13 @@
105108

106109
ws.onopen = () => {
107110
ws.send("PLAYER: Spotify Desktop");
108-
console.log("Open")
111+
currState = 1;
109112
currentMusicInfo = {};
110113
sendData = setInterval(updateInfo, 500);
111114
};
112115

113116
ws.onclose = () => {
114117
clearInterval(sendData);
115-
console.log("restart")
116118
setTimeout(init, 2000);
117119
};
118120

0 commit comments

Comments
 (0)