mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 11:28:23 -07:00
58 lines
1.6 KiB
JavaScript
58 lines
1.6 KiB
JavaScript
(function ($, document) {
|
|
|
|
$(document).on('pagebeforeshow', "#moviesLatestPage", function () {
|
|
|
|
var screenWidth = $(window).width();
|
|
|
|
var page = this;
|
|
|
|
var options = {
|
|
|
|
SortBy: "DateCreated",
|
|
SortOrder: "Descending",
|
|
IncludeItemTypes: "Movie",
|
|
Limit: screenWidth >= 1920 ? 32 : (screenWidth >= 1440 ? 24 : (screenWidth >= 800 ? 18 : 12)),
|
|
Recursive: true,
|
|
Fields: "PrimaryImageAspectRatio",
|
|
Filters: "IsUnplayed"
|
|
};
|
|
|
|
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
|
|
|
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
|
|
items: result.Items
|
|
|
|
})).createPosterItemMenus();
|
|
});
|
|
|
|
|
|
options = {
|
|
|
|
SortBy: "DateCreated",
|
|
SortOrder: "Descending",
|
|
IncludeItemTypes: "Trailer",
|
|
Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 8 : 6),
|
|
Recursive: true,
|
|
Fields: "PrimaryImageAspectRatio",
|
|
Filters: "IsUnplayed"
|
|
};
|
|
|
|
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
|
|
|
if (result.Items.length) {
|
|
$('#trailerSection', page).show();
|
|
} else {
|
|
$('#trailerSection', page).hide();
|
|
}
|
|
|
|
$('#trailerItems', page).html(LibraryBrowser.getPosterViewHtml({
|
|
items: result.Items
|
|
|
|
})).createPosterItemMenus();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
})(jQuery, document); |