Fix: get current song only on song change

This commit is contained in:
jcorporation 2018-10-08 21:58:25 +01:00
parent ceb694b7b2
commit 61adcb1c59
1 changed files with 2 additions and 1 deletions

View File

@ -1055,7 +1055,8 @@ function parseState(obj) {
setCounter(obj.data.currentSongId, obj.data.totalTime, obj.data.elapsedTime);
//Get current song
sendAPI({"cmd": "MPD_API_PLAYER_CURRENT_SONG"}, songChange);
if (lastState && lastState.data.currentSongId != obj.data.currentSongId)
sendAPI({"cmd": "MPD_API_PLAYER_CURRENT_SONG"}, songChange);
//clear playback card if not playing
if (obj.data.songPos == '-1') {
domCache.currentTrack.innerText = 'Not playing';