<ul id="nav_links" class="nav navbar-nav">
<li id="queue"><a href="#/">Queue</a></li>
- <li id="browse"><a href="#/browse/0/">Browse database</a></li>
+ <li id="browse"><a href="#/browse/0/">Browse Database</a></li>
<li id="dirble"><a href="#/dirble/">Dirble</a></li>
<li><a href="#" data-toggle="modal" data-target="#addstream">Add Stream</a></li>
<li><a href="#" data-toggle="modal" data-target="#settings" onclick="getHost();">Settings</a></li>
<div id="btn-responsive-block" class="btn-group-vertical btn-block btn-group-lg">
<button type="button" class="btn btn-default" onclick="socket.send('MPD_API_RM_ALL');">
- <span class="glyphicon glyphicon-trash"></span> Clear queue
+ <span class="glyphicon glyphicon-trash"></span> Clear Queue
</button>
<a href="#" data-toggle="modal" data-target="#savequeue" class="btn btn-default">
- <span class="glyphicon glyphicon-save"></span> Save queue
+ <span class="glyphicon glyphicon-save"></span> Save Queue
</a>
</div>
var obj = JSON.parse(msg.data);
switch (obj.type) {
- case "queue":
+ case 'queue':
if(current_app !== 'queue')
break;
$('#salamisandwich > tbody').append(
"<tr trackid=\"" + obj.data[song].id + "\"><td>" + (obj.data[song].pos + 1) + "</td>" +
- "<td>"+ obj.data[song].title +"</td>" +
- "<td>"+ minutes + ":" + (seconds < 10 ? '0' : '') + seconds +
+ "<td>" + obj.data[song].artist + " [" + obj.data[song].album + "] - " + obj.data[song].title + "</td>" +
+ "<td>" + minutes + ":" + (seconds < 10 ? '0' : '') + seconds +
"</td><td></td></tr>");
}
};
//Make queue table sortable
- $("#salamisandwich > tbody").sortable({
+ $('#salamisandwich > tbody').sortable({
helper: fixHelperModified,
stop: function(event,ui) {renumber_table('#salamisandwich',ui.item)}
}).disableSelection();
break;
- case "search":
+ case 'search':
$('#wait').modal('hide');
- case "browse":
+ case 'browse':
if(current_app !== 'browse' && current_app !== 'search')
break;
}
for (var item in obj.data) {
switch(obj.data[item].type) {
- case "directory":
+ case 'directory':
var clazz = 'dir';
if (filter !== undefined) {
var first = obj.data[item].dir[0];
"<td></td><td></td></tr>"
);
break;
- case "playlist":
+ case 'playlist':
var clazz = 'plist';
if (filter !== "||") {
clazz += ' hide';
"<td></td><td></td></tr>"
);
break;
- case "song":
+ case 'song':
var minutes = Math.floor(obj.data[item].duration / 60);
var seconds = obj.data[item].duration - minutes * 60;
- $('#salamisandwich > tbody').append(
+ $('#salamisandwich > tbody').append(
"<tr uri=\"" + encodeURI(obj.data[item].uri) + "\" class=\"song\">" +
"<td><span class=\"glyphicon glyphicon-music\"></span></td>" +
- "<td>" + obj.data[item].title +"</td>" +
- "<td>"+ minutes + ":" + (seconds < 10 ? '0' : '') + seconds +
+ "<td>" + (typeof obj.data[item].artist !== 'undefined' ? obj.data[item].artist + " [" + obj.data[item].album + "] - " : '') + obj.data[item].title + "</td>" +
+ "<td>" + minutes + ":" + (seconds < 10 ? '0' : '') + seconds +
"</td><td></td></tr>"
);
break;
- case "wrap":
+ case 'wrap':
if(current_app == 'browse') {
$('#next').removeClass('hide');
} else {
return str;
}
+char* mpd_get_artist(struct mpd_song const *song)
+{
+ char *str;
+
+ str = (char *)mpd_song_get_tag(song, MPD_TAG_ARTIST, 0);
+
+ return str;
+}
+
+char* mpd_get_album(struct mpd_song const *song)
+{
+ char *str;
+
+ str = (char *)mpd_song_get_tag(song, MPD_TAG_ALBUM, 0);
+
+ return str;
+}
+
int mpd_put_state(char *buffer, int *current_song_id, unsigned *queue_version)
{
struct mpd_status *status;
cur += json_emit_int(cur, end - cur, mpd_song_get_pos(song));
cur += json_emit_raw_str(cur, end - cur, ",\"title\":");
cur += json_emit_quoted_str(cur, end - cur, mpd_get_title(song));
-
- if(mpd_song_get_tag(song, MPD_TAG_ARTIST, 0) != NULL)
- {
- cur += json_emit_raw_str(cur, end - cur, ",\"artist\":");
- cur += json_emit_quoted_str(cur, end - cur, mpd_song_get_tag(song, MPD_TAG_ARTIST, 0));
- }
-
- if(mpd_song_get_tag(song, MPD_TAG_ALBUM, 0) != NULL)
- {
- cur += json_emit_raw_str(cur, end - cur, ",\"album\":");
- cur += json_emit_quoted_str(cur, end - cur, mpd_song_get_tag(song, MPD_TAG_ALBUM, 0));
- }
+ 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, "}}");
mpd_song_free(song);
cur += json_emit_int(cur, end - cur, mpd_song_get_duration(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\":");
+ 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, "},");
}
mpd_entity_free(entity);
cur += json_emit_int(cur, end - cur, mpd_song_get_duration(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\":");
+ 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, "},");
mpd_song_free(song);