File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 ( ) ) ,
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 ( ) ;
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
You can’t perform that action at this time.
0 commit comments