mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
75 lines
1.8 KiB
JavaScript
75 lines
1.8 KiB
JavaScript
(function ($, document) {
|
|
|
|
// The base query options
|
|
var query = {
|
|
|
|
SortBy: "SortName",
|
|
SortOrder: "Ascending",
|
|
IncludeItemTypes: "GameSystem",
|
|
Recursive: true,
|
|
Fields: "DateCreated",
|
|
StartIndex: 0,
|
|
ImageTypeLimit: 1,
|
|
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
|
};
|
|
|
|
function getSavedQueryKey() {
|
|
|
|
return 'gamesystems' + (query.ParentId || '');
|
|
}
|
|
|
|
function reloadItems(page) {
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
|
|
|
// Scroll back up so they can see the results from the beginning
|
|
$(document).scrollTop(0);
|
|
|
|
updateFilterControls(page);
|
|
|
|
var html = LibraryBrowser.getPosterViewHtml({
|
|
items: result.Items,
|
|
shape: "backdrop",
|
|
context: 'games',
|
|
showTitle: true,
|
|
centerText: true,
|
|
lazy: true
|
|
|
|
});
|
|
|
|
$('#items', page).html(html).lazyChildren();
|
|
|
|
LibraryBrowser.saveQueryValues(getSavedQueryKey(), query);
|
|
|
|
Dashboard.hideLoadingMsg();
|
|
});
|
|
}
|
|
|
|
function updateFilterControls(page) {
|
|
|
|
// Reset form values using the last used query
|
|
}
|
|
|
|
$(document).on('pageshowready', "#gamesystemsPage", function () {
|
|
|
|
query.ParentId = LibraryMenu.getTopParentId();
|
|
|
|
var limit = LibraryBrowser.getDefaultPageSize();
|
|
|
|
// If the default page size has changed, the start index will have to be reset
|
|
if (limit != query.Limit) {
|
|
query.Limit = limit;
|
|
query.StartIndex = 0;
|
|
}
|
|
|
|
LibraryBrowser.loadSavedQueryValues(getSavedQueryKey(), query);
|
|
|
|
reloadItems(this);
|
|
|
|
updateFilterControls(this);
|
|
});
|
|
|
|
})(jQuery, document);
|