jellyfin-web/dashboard-ui/scripts/movieslatest.js
2014-12-11 01:20:28 -05:00

35 lines
1000 B
JavaScript

(function ($, document) {
$(document).on('pagebeforeshow', "#moviesLatestPage", function () {
var parentId = LibraryMenu.getTopParentId();
var userId = Dashboard.getCurrentUserId();
var page = this;
var options = {
IncludeItemTypes: "Movie",
Limit: 30,
Fields: "PrimaryImageAspectRatio,MediaSourceCount,SyncInfo",
ParentId: parentId,
IsPlayed: false,
ImageTypeLimit: 1,
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
};
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).done(function (items) {
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
items: items,
lazy: true,
shape: 'homePagePortrait',
overlayText: false
})).trigger('create').createCardMenus();
});
});
})(jQuery, document);