From: eb041592 <35889760+eb041592@users.noreply.github.com> Date: Wed, 4 Apr 2018 22:59:39 +0000 (+0200) Subject: Revert some changes: There's no need to print the artist/album for each song while... X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=2cb99de8521cdbe0aaa85eb7526360ebc75f0b77;p=ympd.git Revert some changes: There's no need to print the artist/album for each song while browsing. --- 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 + "" );