jellyfin-web/dashboard-ui/scripts/movieslatest.js
2014-07-11 00:27:46 -04:00

33 lines
937 B
JavaScript

(function ($, document) {
$(document).on('pagebeforeshow', "#moviesLatestPage", function () {
var parentId = LibraryMenu.getTopParentId();
var userId = Dashboard.getCurrentUserId();
var screenWidth = $(window).width();
var page = this;
var options = {
IncludeItemTypes: "Movie",
Limit: screenWidth >= 1920 ? 30 : (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,
lazy: true
})).trigger('create').createPosterItemMenus();
});
});
})(jQuery, document);