Merge remote-tracking branch 'eb041592/queue_time'
authorSuperBFG7 <daniel@despite.ch>
Sun, 22 Apr 2018 16:57:02 +0000 (18:57 +0200)
committerSuperBFG7 <daniel@despite.ch>
Sun, 22 Apr 2018 16:57:02 +0000 (18:57 +0200)
1  2 
htdocs/css/mpd.css
htdocs/index.html
htdocs/js/mpd.js
src/mpd_client.c

Simple merge
Simple merge
@@@ -417,18 -364,17 +435,19 @@@ 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 = "<td colspan=\"2\">" + obj.data[item].title + "</td>";
+                                 if (obj.data[item].artist == null) {
+                                     var artist = "<td colspan=\"2\">";
                                  } else {
-                                     var details = "<td>" + obj.data[item].artist + "<br /><span>" + obj.data[item].album + "</span></td><td>" + obj.data[item].title + "</td>";
+                                     var artist = "<td>" + obj.data[item].artist +
+                                                      "<span>" + obj.data[item].album + "</span></td><td>";
                                  }
  
-                               $('#salamisandwich > tbody').append(
+                                 $('#salamisandwich > tbody').append(
                                      "<tr uri=\"" + encodeURI(obj.data[item].uri) + "\" class=\"song\">" +
 -                                    "<td><span class=\"glyphicon glyphicon-music\"></span></td>" +
 -                                    artist + obj.data[item].title + "</td>" +
 +                                    "<td><span class=\"glyphicon glyphicon-music\"></span></td>" + 
 +                                    "<td>" + obj.data[item].title  + "</td>" +
 +                                    "<td>" + obj.data[item].album  + "</td>" +
 +                                    "<td>" + obj.data[item].artist + "</td>" + 
                                      "<td>" + minutes + ":" + (seconds < 10 ? '0' : '') + seconds +
                                      "</td><td></td></tr>"
                                  );
@@@ -629,11 -620,7 +632,11 @@@ int mpd_put_queue(char *buffer, unsigne
              cur += json_emit_raw_str(cur, end - cur, ",\"pos\":");
              cur += json_emit_int(cur, end - cur, mpd_song_get_pos(song));
              cur += json_emit_raw_str(cur, end - cur, ",\"duration\":");
-             cur += json_emit_int(cur, end - cur, mpd_song_get_duration(song));
+             cur += json_emit_int(cur, end - cur, drtn);
 +            cur += json_emit_raw_str(cur, end - cur, ",\"artist\":");
 +            cur += json_emit_quoted_str(cur, end - cur, mpd_get_artist(song));
 +            cur += json_emit_raw_str(cur, end - cur, ",\"album\":");
 +            cur += json_emit_quoted_str(cur, end - cur, mpd_get_album(song));
              cur += json_emit_raw_str(cur, end - cur, ",\"title\":");
              cur += json_emit_quoted_str(cur, end - cur, mpd_get_title(song));
              cur += json_emit_raw_str(cur, end - cur, ",\"artist\":");