1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Validate channel page size

This commit is contained in:
Luke Pulverenti 2014-05-28 22:21:41 -04:00
parent 9d62fb3c7f
commit 81488383b6

View file

@ -1,7 +1,7 @@
(function ($, document) {
var maxPageSize;
// The base query options
var query = {
@ -9,7 +9,7 @@
SortOrder: "Ascending",
StartIndex: 0
};
function getPageSizes() {
var sizes = [];
@ -20,7 +20,7 @@
if (!maxPageSize || maxPageSize >= 40) sizes.push(40);
if (!maxPageSize || maxPageSize >= 50) sizes.push(50);
if (!maxPageSize || maxPageSize >= 100) sizes.push(100);
return sizes;
}
@ -60,8 +60,12 @@
maxPageSize = features.MaxPageSize;
if (maxPageSize) {
query.Limit = Math.min(maxPageSize, query.Limit || maxPageSize);
}
updateSortOrders(page, features.DefaultSortFields);
reloadItems(page);
});
}
@ -77,7 +81,7 @@
}
function updateSortOrder(page, fields, name) {
var cssClass = "sortby" + name;
if (fields.indexOf(name) == -1) {
@ -115,7 +119,7 @@
}
query.folderId = folderId;
$.getJSON(ApiClient.getUrl("Channels/" + channelId + "/Items", query)).done(function (result) {
// Scroll back up so they can see the results from the beginning