1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/dashboard-ui/scripts/tvrecommended.js

45 lines
1.1 KiB
JavaScript
Raw Normal View History

2013-04-01 18:28:01 -07:00
(function ($, document) {
2014-02-23 00:52:30 -05:00
function loadNextUp(page) {
2013-04-30 23:28:26 -04:00
2014-05-09 15:43:06 -04:00
var screenWidth = $(window).width();
2014-02-23 00:52:30 -05:00
var options = {
Limit: 24,
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated",
UserId: Dashboard.getCurrentUserId(),
2014-05-29 15:34:20 -04:00
ExcludeLocationTypes: "Virtual"
2013-04-30 23:28:26 -04:00
};
2014-02-23 00:52:30 -05:00
ApiClient.getNextUpEpisodes(options).done(function (result) {
2013-04-30 23:28:26 -04:00
if (result.Items.length) {
2014-03-31 17:04:22 -04:00
$('.noNextUpItems', page).hide();
2013-04-30 23:28:26 -04:00
} else {
2014-03-31 17:04:22 -04:00
$('.noNextUpItems', page).show();
2013-04-30 23:28:26 -04:00
}
2014-03-31 17:04:22 -04:00
$('#nextUpItems', page).html(LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "backdrop",
showTitle: true,
showParentTitle: true,
2014-05-29 15:34:20 -04:00
overlayText: screenWidth >= 600,
context: 'home-nextup',
lazy: true
2014-02-23 00:52:30 -05:00
2014-05-29 15:34:20 -04:00
})).trigger('create').createPosterItemMenus();
2013-04-30 23:28:26 -04:00
});
2014-02-23 00:52:30 -05:00
}
$(document).on('pagebeforeshow', "#tvRecommendedPage", function () {
var page = this;
2013-04-30 23:28:26 -04:00
2014-02-23 00:52:30 -05:00
loadNextUp(page);
2013-04-30 23:28:26 -04:00
});
2013-04-01 18:28:01 -07:00
})(jQuery, document);