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

Merge pull request #4786 from v0idMrK/Sorting-Only-Thumbnail-Fix-5584

Add sort options to playback requests
This commit is contained in:
Bill Thornton 2023-10-18 14:06:19 -04:00 committed by GitHub
commit edd94053ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 53 additions and 15 deletions

View file

@ -622,6 +622,21 @@ export class UserSettings {
getFilter(key) {
return this.get(key, true);
}
/**
* Gets the current sort values (Legacy - Non-JSON)
* (old views such as list.js [Photos] will
* use this one)
* @param {string} key - Filter key.
* @param {string} defaultSortBy - Default SortBy value.
* @return {Object} sortOptions object
*/
getSortValuesLegacy(key, defaultSortBy) {
return {
sortBy: this.getFilter(key + '-sortby') || defaultSortBy,
sortOrder: this.getFilter(key + '-sortorder') === 'Descending' ? 'Descending' : 'Ascending'
};
}
}
export const currentSettings = new UserSettings;
@ -672,3 +687,4 @@ export const customCss = currentSettings.customCss.bind(currentSettings);
export const disableCustomCss = currentSettings.disableCustomCss.bind(currentSettings);
export const getSavedView = currentSettings.getSavedView.bind(currentSettings);
export const saveViewSetting = currentSettings.saveViewSetting.bind(currentSettings);
export const getSortValuesLegacy = currentSettings.getSortValuesLegacy.bind(currentSettings);