jellyfin-web/dashboard-ui/scripts/movieslatest.js
2014-05-01 22:54:33 -04:00

35 lines
963 B
JavaScript

(function ($, document) {
$(document).on('pagebeforeshow', "#moviesLatestPage", function () {
var parentId = LibraryMenu.getTopParentId();
var screenWidth = $(window).width();
var page = this;
var options = {
SortBy: "DateCreated",
SortOrder: "Descending",
IncludeItemTypes: "Movie",
Limit: screenWidth >= 1920 ? 32 : (screenWidth >= 1440 ? 32 : (screenWidth >= 800 ? 24 : 18)),
Recursive: true,
Fields: "PrimaryImageAspectRatio",
Filters: "IsUnplayed",
CollapseBoxSetItems: false,
ParentId: parentId
};
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
items: result.Items
})).createPosterItemMenus();
});
});
})(jQuery, document);