function generateRowHTML(child, appendto, rowcolor) {
var albumhtml;
var isDir;
var i;
isDir = child.isDir;
if (isDir === true) {
albumhtml = generateAlbumHTML(rowcolor, child.id, child.parent, child.coverArt, child.title, child.artist, child.userRating);
} else {
var track;
if (child.track === undefined) { track = " "; } else { track = child.track; }
var time = secondsToTime(child.duration);
albumhtml = generateSongHTML(rowcolor, child.id, child.parent, track, child.title, child.artist, child.album, child.coverArt, child.userRating, time['m'], time['s']);
}
return albumhtml;
//$(albumhtml).appendTo(appendto);
}
function generateAlbumHeaderHTML() {
var html;
html = '
| | Album | Artist |
';
return html;
}
function generateAlbumHTML(rowcolor, childid, parentid, coverart, title, artist, rating) {
var html;
html = '';
html += '';
html += '';
html += '';
if (rating === 5) {
html += '';
} else {
html += '';
}
html += ' | ';
if (coverart == undefined) {
html += ' | ';
} else {
html += ' | ';
}
html += '' + title + ' | ';
html += '' + artist + ' | ';
html += '
';
return html;
}
function generateSongHeaderHTML() {
var html;
html = ' | Track | Title | Artist | Album | Time |
';
return html;
}
function generateSongHTML(rowcolor, childid, parentid, track, title, artist, album, coverart, rating, m, s) {
var html;
html = '';
html += '';
html += '';
html += '';
html += '';
if (rating === 5) {
html += '';
} else {
html += '';
}
html += ' | ';
html += '' + track + ' | ';
html += '' + title + ' | ';
html += '' + artist + ' | ';
var coverartSrc;
if (coverart == undefined) {
coverartSrc = 'images/albumdefault_25.jpg';
} else {
coverartSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=jsonp&size=25&id=' + coverart;
}
html += ' ' + album + ' | ';
html += '' + m + ':' + s + ' | ';
html += '
';
return html;
}
function generatePodcastHTML(rowcolor, childid, parentid, track, title, description, artist, album, coverart, rating, m, s) {
var html;
html = '';
html += '';
html += '';
html += '';
html += '';
if (rating === 5) {
html += '';
} else {
html += '';
}
html += ' | ';
html += '' + track + ' | ';
html += '' + title + ' | ';
html += '' + artist + ' | ';
var coverartSrc;
if (coverart == undefined) {
coverartSrc = 'images/albumdefault_25.jpg';
} else {
coverartSrc = baseURL + '/getCoverArt.view?v=' + version + '&c=' + applicationName + '&f=jsonp&size=25&id=' + coverart;
}
html += ' ' + album + ' | ';
html += '' + m + ':' + s + ' | ';
html += '
';
return html;
}
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);
});
}