From 2cb99de8521cdbe0aaa85eb7526360ebc75f0b77 Mon Sep 17 00:00:00 2001 From: eb041592 <35889760+eb041592@users.noreply.github.com> Date: Thu, 5 Apr 2018 00:59:39 +0200 Subject: [PATCH] Revert some changes: There's no need to print the artist/album for each song while browsing. --- htdocs/js/mpd.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 + "" ); -- 2.20.1