diff --git a/htdocs/js/mpd.js b/htdocs/js/mpd.js index ef1ad1d..13fd4e4 100644 --- a/htdocs/js/mpd.js +++ b/htdocs/js/mpd.js @@ -364,17 +364,17 @@ function webSocketConnect() { var minutes = Math.floor(obj.data[item].duration / 60); var seconds = obj.data[item].duration - minutes * 60; -// if (typeof obj.data[item].artist === 'undefined') { -// var details = "" + obj.data[item].title + ""; -// } else { -// var details = "" + obj.data[item].artist + "" + obj.data[item].album + "" + obj.data[item].title + ""; -// } + if (obj.data[item].artist == null) { + var artist = ""; + } else { + var artist = "" + obj.data[item].artist + + "" + obj.data[item].album + ""; + } $('#salamisandwich > tbody').append( "" + "" + - "" + obj.data[song].artist + "" + obj.data[song].album + "" + - "" + obj.data[song].title + "" + + artist + obj.data[item].title + "" + "" + minutes + ":" + (seconds < 10 ? '0' : '') + seconds + "" );