jellyfin-web/dashboard-ui/scripts/movieslatest.js

35 lines
1009 B
JavaScript
Raw Normal View History

(function ($, document) {
$(document).on('pagebeforeshow', "#moviesLatestPage", function () {
2014-05-01 19:54:33 -07:00
var parentId = LibraryMenu.getTopParentId();
var userId = Dashboard.getCurrentUserId();
var screenWidth = $(window).width();
var page = this;
var options = {
IncludeItemTypes: "Movie",
2014-07-17 15:21:35 -07:00
Limit: screenWidth >= 1600 ? 28 : (screenWidth >= 1440 ? 30 : (screenWidth >= 800 ? 28 : 18)),
Fields: "PrimaryImageAspectRatio",
ParentId: parentId,
IsPlayed: false
};
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).done(function (items) {
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
items: items,
2014-08-01 19:34:45 -07:00
lazy: true,
shape: 'homePagePortrait',
overlayText: true
2014-08-01 19:34:45 -07:00
})).trigger('create').createCardMenus();
});
});
})(jQuery, document);