mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
60 lines
1.6 KiB
JavaScript
60 lines
1.6 KiB
JavaScript
(function ($, document) {
|
|
|
|
$(document).on('pagebeforeshow', "#gamesRecommendedPage", function () {
|
|
|
|
var parentId = LibraryMenu.getTopParentId();
|
|
|
|
var page = this;
|
|
|
|
var options = {
|
|
|
|
SortBy: "DateCreated",
|
|
SortOrder: "Descending",
|
|
MediaTypes: "Game",
|
|
Limit: 8,
|
|
Recursive: true,
|
|
Fields: "ItemCounts,AudioInfo,PrimaryImageAspectRatio",
|
|
ParentId: parentId
|
|
};
|
|
|
|
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
|
|
|
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
|
|
items: result.Items,
|
|
transparent: true,
|
|
borderless: true
|
|
}));
|
|
|
|
});
|
|
|
|
options = {
|
|
|
|
SortBy: "DatePlayed",
|
|
SortOrder: "Descending",
|
|
MediaTypes: "Game",
|
|
Limit: 8,
|
|
Recursive: true,
|
|
Filters: "IsPlayed",
|
|
Fields: "ItemCounts,AudioInfo,PrimaryImageAspectRatio",
|
|
ParentId: parentId
|
|
};
|
|
|
|
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
|
|
|
if (result.Items.length) {
|
|
$('#recentlyPlayedSection', page).show();
|
|
} else {
|
|
$('#recentlyPlayedSection', page).hide();
|
|
}
|
|
|
|
$('#recentlyPlayedItems', page).html(LibraryBrowser.getPosterViewHtml({
|
|
items: result.Items,
|
|
transparent: true,
|
|
borderless: true
|
|
}));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
})(jQuery, document); |