mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
(function ($, document) {
|
|
|
|
function loadNextUp(page) {
|
|
|
|
var screenWidth = $(window).width();
|
|
|
|
var options = {
|
|
|
|
Limit: 24,
|
|
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated",
|
|
UserId: Dashboard.getCurrentUserId(),
|
|
ExcludeLocationTypes: "Virtual"
|
|
};
|
|
|
|
ApiClient.getNextUpEpisodes(options).done(function (result) {
|
|
|
|
if (result.Items.length) {
|
|
$('.noNextUpItems', page).hide();
|
|
} else {
|
|
$('.noNextUpItems', page).show();
|
|
}
|
|
|
|
$('#nextUpItems', page).html(LibraryBrowser.getPosterViewHtml({
|
|
items: result.Items,
|
|
shape: "backdrop",
|
|
showTitle: true,
|
|
showParentTitle: true,
|
|
overlayText: screenWidth >= 600,
|
|
context: 'home-nextup',
|
|
lazy: true
|
|
|
|
})).trigger('create').createPosterItemMenus();
|
|
|
|
});
|
|
}
|
|
|
|
$(document).on('pagebeforeshow', "#tvRecommendedPage", function () {
|
|
|
|
var page = this;
|
|
|
|
loadNextUp(page);
|
|
});
|
|
|
|
|
|
})(jQuery, document); |