mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-24 06:05:56 -05:00
Fix for songs with empty tags not being displayed in the web UI.
This commit is contained in:
parent
ab681005c9
commit
cbc3ddf143
@ -99,13 +99,29 @@ function playlistSelect(event) {
|
|||||||
|
|
||||||
items = g_req.responseXML.getElementsByTagName('dmap.listingitem');
|
items = g_req.responseXML.getElementsByTagName('dmap.listingitem');
|
||||||
|
|
||||||
|
|
||||||
for (i=0; i < items.length; i++) {
|
for (i=0; i < items.length; i++) {
|
||||||
song = items[i].getElementsByTagName('dmap.itemname').item(0).textContent;
|
// Have to check if the tag really was returned from the server
|
||||||
|
if (song = items[i].getElementsByTagName('dmap.itemname').item(0)) {
|
||||||
|
song = song.textContent;
|
||||||
|
} else {
|
||||||
|
song = '';
|
||||||
|
}
|
||||||
time = ''; //items[i].getElementsByTagName('daap.songtime').item(0).textContent;
|
time = ''; //items[i].getElementsByTagName('daap.songtime').item(0).textContent;
|
||||||
artist = items[i].getElementsByTagName('daap.songartist').item(0).textContent;
|
if (artist = items[i].getElementsByTagName('daap.songartist').item(0)) {
|
||||||
album = items[i].getElementsByTagName('daap.songalbum').item(0).textContent;
|
artist = artist.textContent;
|
||||||
genre = items[i].getElementsByTagName('daap.songgenre').item(0).textContent;
|
} else {
|
||||||
|
artist = '';
|
||||||
|
}
|
||||||
|
if (album = items[i].getElementsByTagName('daap.songalbum').item(0)) {
|
||||||
|
album = album.textContent;
|
||||||
|
} else {
|
||||||
|
album = '';
|
||||||
|
}
|
||||||
|
if (genre = items[i].getElementsByTagName('daap.songgenre').item(0)) {
|
||||||
|
genre = genre.textContent;
|
||||||
|
} else {
|
||||||
|
genre = '';
|
||||||
|
}
|
||||||
addRow(tableBody,song,time,artist,album,genre);
|
addRow(tableBody,song,time,artist,album,genre);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user