2013-05-01 06:45:25 -07:00
|
|
|
|
(function ($, document) {
|
|
|
|
|
|
|
|
|
|
$(document).on('pagebeforeshow', "#tvNextUpPage", function () {
|
|
|
|
|
|
|
|
|
|
var page = this;
|
|
|
|
|
|
|
|
|
|
var options = {
|
|
|
|
|
|
|
|
|
|
Limit: 24,
|
|
|
|
|
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated",
|
|
|
|
|
UserId: Dashboard.getCurrentUserId()
|
|
|
|
|
};
|
|
|
|
|
|
2013-05-04 13:02:20 -07:00
|
|
|
|
ApiClient.getNextUpEpisodes(options).done(function (result) {
|
2013-05-01 06:45:25 -07:00
|
|
|
|
|
|
|
|
|
if (result.Items.length) {
|
|
|
|
|
$('#resumableSection', page).show();
|
|
|
|
|
} else {
|
|
|
|
|
$('#resumableSection', page).hide();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (result.Items.length) {
|
|
|
|
|
|
|
|
|
|
$('#nextUpItems', page).html(LibraryBrowser.getPosterViewHtml({
|
|
|
|
|
items: result.Items,
|
|
|
|
|
useAverageAspectRatio: true,
|
|
|
|
|
shape: "backdrop",
|
|
|
|
|
showTitle: true,
|
|
|
|
|
showParentTitle: true
|
|
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
$('#nextUpItems', page).html('<br/><p style="text-align:center;">None found. Start watching your shows!</p>');
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})(jQuery, document);
|