(function (window) {
function playlist() {
var self = this;
return self;
}
window.Playlist = new playlist();
})(window);
(function ($, document) {
$(document).on('pagebeforeshow', "#playlistPage", function () {
var page = this;
Dashboard.showLoadingMsg();
$("#queueTable").html('');
//currently playing item
if (MediaPlayer.playing) {
var html = '';
html += '
';
html += ' | ';
html += '' + MediaPlayer.playing.Name + ' | ';
html += '' + MediaPlayer.playing.Album + ' | ';
html += '' + ticks_to_human(MediaPlayer.playing.RunTimeTicks) + ' | ';
html += '' + LibraryBrowser.getUserDataIconsHtml(MediaPlayer.playing) + ' | ';
html += ' | ';
html += '
';
$("#queueTable").append(html);
}
$.each(MediaPlayer.queue, function(i, item){
var html = '';
var name = item.Name;
if (item.IndexNumber != null) {
name = item.IndexNumber + " - " + name;
}
if (item.ParentIndexNumber != null) {
name = item.ParentIndexNumber + "." + name;
}
//$('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item));
if (item.SeriesName || item.Album) {
var seriesName = item.SeriesName || item.Album;
}else {
var seriesName = item.ProductionYear;
}
html += '';
html += ' | ';
html += '' + name + ' | ';
html += '' + seriesName + ' | ';
html += '' + ticks_to_human(item.RunTimeTicks) + ' | ';
html += '' + LibraryBrowser.getUserDataIconsHtml(item) + ' | ';
html += 'remove | ';
html += '
';
$("#queueTable").append(html);
});
Dashboard.hideLoadingMsg();
});
})(jQuery, document);