function generateRowHTML(child, appendto, artistid) {
var html, isDir, starred, duration, artistid, artist, i;
isDir = child.isDir;
if (typeof child.starred != 'undefined') { starred = true; } else { starred = false; }
if (typeof child.duration != 'undefined') { duration = child.duration; } else { duration = ''; }
if (typeof child.artist != 'undefined') { artist = child.artist; } else { artist = ''; }
//if (typeof child.artistId != 'undefined') { artistid = child.artistId; } else { artistid = ''; }
if (isDir === true) {
html = generateAlbumHTML(child.id, child.parent, child.coverArt, child.title, artist, child.userRating, starred, child.created);
} else {
var track;
if (child.track === undefined) { track = " "; } else { track = child.track; }
html = generateSongHTML(child.id, child.parent, artistid, track, child.title, '', artist, child.album, child.coverArt, child.userRating, starred, duration);
}
return html;
}
function generateAlbumHeaderHTML() {
var html;
html = '
| | Album | Artist | Created |
';
return html;
}
function generateAlbumHTML(childid, parentid, coverart, title, artist, rating, starred, created) {
var html;
html = '';
html += '';
html += ' ';
html += ' ';
if (starred) {
html += ' ';
} else {
html += ' ';
}
html += ' | ';
if (coverart == undefined) {
html += ' | ';
} else {
html += ' | ';
}
html += '' + title + ' | ';
html += '' + artist + ' | ';
html += '' + $.format.date(new Date(created), "yyyy-MM-dd h:mm a") + ' | ';
html += '
';
return html;
}
function generateSongHeaderHTML() {
var html;
html = ' | Track | Title | Artist | Album | Time |
';
return html;
}
function generateSongHTML(childid, parentid, artistid, track, title, description, artist, album, coverart, rating, starred, duration) {
var time;
if (duration == '') {
time = '00:00'
} else {
time = secondsToTime(duration);
}
var html;
html = '';
html += '';
html += ' ';
html += ' ';
html += ' ';
if (starred) {
html += ' ';
} else {
html += ' ';
}
html += ' | ';
html += '' + track + ' | ';
if (description != '' && description != null) {
html += '' + title + ' | ';
} else {
html += '' + title + ' | ';
}
html += '' + artist + ' | ';
//html += '' + artist + ' | ';
var coverartSrc;
if (coverart == undefined) {
coverartSrc = 'images/albumdefault_25.jpg';
} else {
coverartSrc = baseURL + '/getCoverArt.view?' + baseParams + '&size=25&id=' + coverart;
}
html += ' ' + album + ' | ';
html += '' + time + ' | ';
html += '
';
return html;
}
// Depreciated: 10/17/2012
function refreshRowColor(el) {
$.each($(el + ' tr.song'), function (i) {
$(this).removeClass('even odd');
var rowcolor;
if (i % 2 === 0) {
rowcolor = 'even';
} else {
rowcolor = 'odd';
}
$(this).addClass(rowcolor);
});
}