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

Add library page size settings on movies

This commit is contained in:
MrTimscampi 2020-03-21 00:26:55 +01:00
parent 10a4901226
commit b34a376691
5 changed files with 32 additions and 2 deletions

View file

@ -186,6 +186,8 @@ define(['require', 'browser', 'layoutManager', 'appSettings', 'pluginManager', '
context.querySelector('#selectLanguage').value = userSettings.language() || '';
context.querySelector('.selectDateTimeLocale').value = userSettings.dateTimeLocale() || '';
context.querySelector('#txtLibraryPageSize').value = userSettings.libraryPageSize() || 100;
selectDashboardTheme.value = userSettings.dashboardTheme() || '';
selectTheme.value = userSettings.theme() || '';
@ -215,6 +217,8 @@ define(['require', 'browser', 'layoutManager', 'appSettings', 'pluginManager', '
userSettingsInstance.soundEffects(context.querySelector('.selectSoundEffects').value);
userSettingsInstance.screensaver(context.querySelector('.selectScreensaver').value);
userSettingsInstance.libraryPageSize(context.querySelector('#txtLibraryPageSize').value);
userSettingsInstance.skin(context.querySelector('.selectSkin').value);
userSettingsInstance.enableFastFadein(context.querySelector('#chkFadein').checked);

View file

@ -143,6 +143,11 @@
<select is="emby-select" class="selectSoundEffects" label="${LabelSoundEffects}"></select>
</div>
<div class="inputContainer inputContainer-withDescription fldFadein">
<input is="emby-input" type="number" id="txtLibraryPageSize" pattern="[0-9]*" required="required" min="0" max="1000" step="1" label="${LabelLibraryPageSize}" />
<div class="fieldDescription">${LabelLibraryPageSizeHelp}</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription fldFadein">
<label>
<input type="checkbox" is="emby-checkbox" id="chkFadein" />

View file

@ -32,7 +32,9 @@ define(["loading", "layoutManager", "userSettings", "events", "libraryBrowser",
return;
}
query.StartIndex += query.Limit;
if (userSettings.libraryPageSize() > 0) {
query.StartIndex += query.Limit;
}
itemsContainer.refreshItems();
}
@ -250,9 +252,13 @@ define(["loading", "layoutManager", "userSettings", "events", "libraryBrowser",
ImageTypeLimit: 1,
EnableImageTypes: "Primary,Backdrop,Banner,Thumb",
StartIndex: 0,
Limit: 100,
ParentId: params.topParentId
};
if (userSettings.libraryPageSize() > 0) {
query['Limit'] = userSettings.libraryPageSize();
}
var isLoading = false;
if (options.mode === "favorites") {

View file

@ -202,6 +202,19 @@ define(['appSettings', 'events'], function (appSettings, events) {
return this.get('screensaver', false);
};
UserSettings.prototype.libraryPageSize = function (val) {
if (val != null) {
return this.set('libraryPageSize', parseInt(val, 10), false);
}
if (parseInt(this.get('libraryPageSize', false), 10) === 0) {
// Explicitely return 0 to avoid returning 100 because 0 is falsy.
return 0;
} else {
return parseInt(this.get('libraryPageSize', false), 10) || 100;
}
};
UserSettings.prototype.soundEffects = function (val) {
if (val != null) {
return this.set('soundeffects', val, false);

View file

@ -688,6 +688,8 @@
"LabelKodiMetadataUserHelp": "Save watch data to NFO files for other applications to utilize.",
"LabelLanNetworks": "LAN networks:",
"LabelLanguage": "Language:",
"LabelLibraryPageSize": "Library page size:",
"LabelLibraryPageSizeHelp": "Sets the amount of items to show on a library page. Set to 0 in order to disable paging.",
"LabelLineup": "Lineup:",
"LabelLocalHttpServerPortNumber": "Local HTTP port number:",
"LabelLocalHttpServerPortNumberHelp": "The TCP port number that Jellyfin's HTTP server should bind to.",