1
0
mirror of https://github.com/SuperBFG7/ympd synced 2024-11-26 06:47:17 +00:00

Rearranged artist and album information in queue and search results.

This commit is contained in:
eb041592 2018-02-03 12:03:33 +01:00
parent 3fe7d9c44c
commit fe0277bfbe
4 changed files with 30 additions and 13 deletions

View File

@ -55,10 +55,15 @@ body {
}
}
#salamisandwich td:nth-child(3), th:nth-child(3) {
#salamisandwich td:nth-last-child(2), th:nth-last-child(2) {
text-align: right;
}
#salamisandwich td:nth-child(2) span {
font-style:italic;
font-size:90%;
}
tbody {
cursor: pointer;
}

View File

@ -114,7 +114,7 @@
<thead>
<tr>
<th>#</th>
<th>Title</th>
<th colspan="2">Track</th>
<th>Duration</th>
<th></th>
</tr>

View File

@ -238,7 +238,8 @@ function webSocketConnect() {
$('#salamisandwich > tbody').append(
"<tr trackid=\"" + obj.data[song].id + "\"><td>" + (obj.data[song].pos + 1) + "</td>" +
"<td>" + obj.data[song].artist + " [" + obj.data[song].album + "] - " + obj.data[song].title + "</td>" +
"<td>" + obj.data[song].artist + "<br /><span>" + obj.data[song].album + "</span></td>" +
"<td>" + obj.data[song].title + "</td>" +
"<td>" + minutes + ":" + (seconds < 10 ? '0' : '') + seconds +
"</td><td></td></tr>");
}
@ -334,7 +335,7 @@ function webSocketConnect() {
$('#salamisandwich > tbody').append(
"<tr uri=\"" + encodeURI(obj.data[item].dir) + "\" class=\"" + clazz + "\">" +
"<td><span class=\"glyphicon glyphicon-folder-open\"></span></td>" +
"<td><a>" + basename(obj.data[item].dir) + "</a></td>" +
"<td colspan=\"2\"><a>" + basename(obj.data[item].dir) + "</a></td>" +
"<td></td><td></td></tr>"
);
break;
@ -346,7 +347,7 @@ function webSocketConnect() {
$('#salamisandwich > tbody').append(
"<tr uri=\"" + encodeURI(obj.data[item].plist) + "\" class=\"" + clazz + "\">" +
"<td><span class=\"glyphicon glyphicon-list\"></span></td>" +
"<td><a>" + basename(obj.data[item].plist) + "</a></td>" +
"<td colspan=\"2\"><a>" + basename(obj.data[item].plist) + "</a></td>" +
"<td></td><td></td></tr>"
);
break;
@ -354,10 +355,15 @@ 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>";
} else {
var details = "<td>" + obj.data[item].artist + "<br /><span>" + obj.data[item].album + "</span></td><td>" + obj.data[item].title + "</td>";
}
$('#salamisandwich > tbody').append(
"<tr uri=\"" + encodeURI(obj.data[item].uri) + "\" class=\"song\">" +
"<td><span class=\"glyphicon glyphicon-music\"></span></td>" +
"<td>" + (typeof obj.data[item].artist !== 'undefined' ? obj.data[item].artist + " [" + obj.data[item].album + "] - " : '') + obj.data[item].title + "</td>" +
"<td><span class=\"glyphicon glyphicon-music\"></span></td>" + details +
"<td>" + minutes + ":" + (seconds < 10 ? '0' : '') + seconds +
"</td><td></td></tr>"
);
@ -368,7 +374,7 @@ function webSocketConnect() {
} else {
$('#salamisandwich > tbody').append(
"<tr><td><span class=\"glyphicon glyphicon-remove\"></span></td>" +
"<td>Too many results, please refine your search!</td>" +
"<td colspan=\"2\">Too many results, please refine your search!</td>" +
"<td></td><td></td></tr>"
);
}

View File

@ -480,8 +480,11 @@ char* mpd_get_artist(struct mpd_song const *song)
char *str;
str = (char *)mpd_song_get_tag(song, MPD_TAG_ARTIST, 0);
if (str == NULL) {
return "";
} else {
return str;
}
}
char* mpd_get_album(struct mpd_song const *song)
@ -489,8 +492,11 @@ char* mpd_get_album(struct mpd_song const *song)
char *str;
str = (char *)mpd_song_get_tag(song, MPD_TAG_ALBUM, 0);
if (str == NULL) {
return "";
} else {
return str;
}
}
int mpd_put_state(char *buffer, int *current_song_id, unsigned *queue_version)