diff --git a/htdocs/css/mpd.css b/htdocs/css/mpd.css index e8646a3..18e5da1 100644 --- a/htdocs/css/mpd.css +++ b/htdocs/css/mpd.css @@ -32,10 +32,12 @@ button { cursor: pointer; } + #counter { font-size: 22px; - margin-left: 10px; +/* margin-left: 10px; min-width: 50px; +*/ } .card { @@ -58,10 +60,10 @@ button { .album-cover { background-size: cover; - border: 1px solid black; +/* border: 1px solid black; border-radius: 5px; overflow: hidden; - margin-bottom: 20px; + margin-bottom: 20px;*/ width: 240px; height: 240px; background-color: #eee; diff --git a/htdocs/index.html b/htdocs/index.html index ea9f31d..7621d81 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -75,18 +75,27 @@
Playback
-
-

+ +
+

+
+
+ +
+ +
+ +

-
-
- -
-
-

  

-
-
+
@@ -777,15 +786,20 @@ diff --git a/htdocs/js/mpd.js b/htdocs/js/mpd.js index 39e2c44..502de29 100644 --- a/htdocs/js/mpd.js +++ b/htdocs/js/mpd.js @@ -1387,16 +1387,31 @@ function parseSongDetails(obj) { var trLen = tr.length; for (var i = 0; i < trLen; i++) { var key = tr[i].getAttribute('data-name'); + if (!key) + continue; var value = obj.data[key]; if (key == 'duration') { var minutes = Math.floor(value / 60); var seconds = value - minutes * 60; value = minutes + ':' + (seconds < 10 ? '0' : '') + seconds; } + else if (key == 'lastPlayed') { + if (value == 0) + value = 'never'; + else { + var d = new Date(value * 1000); + value = d.toUTCString(); + } + } + else if (key == 'like') { + if (value == 0) value = 'thumb_down_alt'; + else if (value == 2) value = 'thumb_up_alt'; + else value = 'not voted'; + } else if (key == 'uri') { value = '' + value + ''; } - tr[i].getElementsByTagName('td')[1].innerHTML = value; + tr[i].getElementsByTagName('td')[0].innerHTML = value; } }