jellyfin-web/dashboard-ui/scripts/gamesrecommendedpage.js
2013-04-28 14:30:58 -04:00

52 lines
1.1 KiB
JavaScript

(function ($, document) {
$(document).on('pagebeforeshow', "#gamesRecommendedPage", function () {
var page = this;
var options = {
SortBy: "DateCreated",
SortOrder: "Descending",
MediaTypes: "Game",
Limit: 5,
Recursive: true,
Fields: "PrimaryImageAspectRatio",
Filters: "IsUnplayed"
};
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
items: result.Items,
useAverageAspectRatio: true,
showNewIndicator: false,
transparent: true
}));
});
options = {
SortBy: "DatePlayed",
SortOrder: "Descending",
MediaTypes: "Game",
Limit: 5,
Recursive: true,
Fields: "PrimaryImageAspectRatio",
Filters: "IsPlayed"
};
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
$('#resumableItems', page).html(LibraryBrowser.getPosterViewHtml({
items: result.Items,
useAverageAspectRatio: true,
transparent: true
}));
});
});
})(jQuery, document);