2013-05-01 06:45:25 -07:00
|
|
|
|
(function ($, document) {
|
|
|
|
|
|
|
|
|
|
$(document).on('pagebeforeshow', "#tvNextUpPage", function () {
|
|
|
|
|
|
2014-02-17 14:35:08 -07:00
|
|
|
|
var screenWidth = $(window).width();
|
|
|
|
|
|
2013-05-01 06:45:25 -07:00
|
|
|
|
var page = this;
|
|
|
|
|
|
|
|
|
|
var options = {
|
|
|
|
|
|
2014-02-17 14:35:08 -07:00
|
|
|
|
Limit: screenWidth >= 1920 ? 25 : 24,
|
2013-05-01 06:45:25 -07:00
|
|
|
|
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated",
|
2013-10-16 16:35:11 -07:00
|
|
|
|
UserId: Dashboard.getCurrentUserId(),
|
|
|
|
|
ExcludeLocationTypes: "Virtual"
|
2013-05-01 06:45:25 -07:00
|
|
|
|
};
|
|
|
|
|
|
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,
|
2013-12-22 10:16:24 -07:00
|
|
|
|
showParentTitle: true,
|
|
|
|
|
overlayText: true
|
2013-05-01 06:45:25 -07:00
|
|
|
|
|
2014-01-14 08:50:39 -07:00
|
|
|
|
})).createPosterItemHoverMenu();
|
2013-05-01 06:45:25 -07:00
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
$('#nextUpItems', page).html('<br/><p style="text-align:center;">None found. Start watching your shows!</p>');
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})(jQuery, document);
|