Added optional covers to SongList

This commit is contained in:
lukeIam committed 2015-12-20 18:39:14 +01:00
1 parent ef3a7e0722
commit 8da297d1be
1 file changed
+18 -1
+18 -1
View File
@@ -1143,9 +1143,26 @@
}
for (var id in allSongsCache) {
$('<li id="selectSongLine_' + allSongsCache[id].SongId + '"> <a href="#"> '/*+'<img src="' + ((data[profile].Avatar && data[profile].Avatar.base64Data) ? data[id].Avatar.base64Data : "img/profile.png") + '"> '*/ + ' <h2>' + allSongsCache[id].Artist + '</h2> <p>' + allSongsCache[id].Title + '</p> </a> </li>')
var coverString = "";
var currentCoverId = "";
if (allSongsCache[id].Cover !== null) {
if (allSongsCache[id].Cover.base64Data !== "") {
coverString = '<img src="' + allSongsCache[id].Cover.base64Data + '">';
}
else if (allSongsCache[id].Cover.imageId !== "") {
currentCoverId = "songListCoverId_" + id;
coverString = '<img id="' + currentCoverId + '" src="">';
}
}
$('<li id="selectSongLine_' + allSongsCache[id].SongId + '"> <a href="#"> ' + coverString + ' <h2>' + allSongsCache[id].Artist + '</h2> <p>' + allSongsCache[id].Title + '</p> </a> </li>')
.appendTo('#selectSongList')
.click(handleSelectSongLineClick);
if (currentCoverId !== "") {
imageLoader.delayedImageLoad($("#" + currentCoverId)[0], allSongsCache[id].Cover.imageId, "img/noCover.png");
}
}
$('#selectSongList').listview('refresh');