From 4d9b27c994e41b262ccdd3c1ee1ba90f81fcbd4d Mon Sep 17 00:00:00 2001 From: eb041592 <35889760+eb041592@users.noreply.github.com> Date: Sat, 7 Apr 2018 11:14:12 +0200 Subject: [PATCH 1/3] Fix display of output buttons --- htdocs/js/mpd.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/js/mpd.js b/htdocs/js/mpd.js index ce2fd8e25..6e886ece6 100644 --- a/htdocs/js/mpd.js +++ b/htdocs/js/mpd.js @@ -493,14 +493,15 @@ function webSocketConnect() { break; case 'outputnames': $('#btn-outputs-block button').remove(); - if (obj.data.length > 1) { - $.each(obj.data, function(id, name){ - var btn = $(''); - btn.appendTo($('#btn-outputs-block')); - }); - } else { - $('#btn-outputs-block').addClass('hide'); - } + var ttl_output = 0; + $.each(obj.data, function(id, name){ + var btn = $(''); + btn.appendTo($('#btn-outputs-block')); + ttl_output++; + }); + if (ttl_output == 1) { $('#btn-outputs-block').addClass('hide'); } /* remove cache, since the buttons have been recreated */ last_outputs = ''; break; From 7a3bc0c45bb9a808f573a816981224ba47b15750 Mon Sep 17 00:00:00 2001 From: eb041592 <35889760+eb041592@users.noreply.github.com> Date: Sat, 7 Apr 2018 11:38:34 +0200 Subject: [PATCH 2/3] Removed default DIRBLE_API_TOKEN from two init scripts --- contrib/ympd.default | 2 +- contrib/ympd.service | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/ympd.default b/contrib/ympd.default index cb3ca72cb..7d48a2153 100644 --- a/contrib/ympd.default +++ b/contrib/ympd.default @@ -3,4 +3,4 @@ MPD_PORT=6600 MPD_PASSWORD= WEB_PORT=8080 YMPD_USER=nobody -DIRBLE_API_TOKEN=2e223c9909593b94fc6577361a +DIRBLE_API_TOKEN= diff --git a/contrib/ympd.service b/contrib/ympd.service index 49559c7f4..379b7911e 100644 --- a/contrib/ympd.service +++ b/contrib/ympd.service @@ -8,7 +8,7 @@ Environment=MPD_PORT=6600 Environment=MPD_PASSWORD= Environment=WEB_PORT=8080 Environment=YMPD_USER=nobody -Environment=DIRBLE_API_TOKEN=2e223c9909593b94fc6577361a +Environment=DIRBLE_API_TOKEN= EnvironmentFile=/etc/default/ympd ExecStart=/usr/bin/ympd --user $YMPD_USER --mpdpass "$MPD_PASSWORD" --webport $WEB_PORT --host $MPD_HOST --port $MPD_PORT --dirbletoken $DIRBLE_API_TOKEN Type=simple From de4878b0f3164d520ec76babd9f1c5085dd7aed0 Mon Sep 17 00:00:00 2001 From: eb041592 <35889760+eb041592@users.noreply.github.com> Date: Mon, 9 Apr 2018 12:06:07 +0200 Subject: [PATCH 3/3] Changed variable name --- htdocs/js/mpd.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/js/mpd.js b/htdocs/js/mpd.js index 6e886ece6..4df335089 100644 --- a/htdocs/js/mpd.js +++ b/htdocs/js/mpd.js @@ -493,15 +493,15 @@ function webSocketConnect() { break; case 'outputnames': $('#btn-outputs-block button').remove(); - var ttl_output = 0; + var num_outputs = 0; $.each(obj.data, function(id, name){ var btn = $(''); btn.appendTo($('#btn-outputs-block')); - ttl_output++; + num_outputs++; }); - if (ttl_output == 1) { $('#btn-outputs-block').addClass('hide'); } + if (num_outputs == 1) { $('#btn-outputs-block').addClass('hide'); } /* remove cache, since the buttons have been recreated */ last_outputs = ''; break;