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
6 changed files with 53 additions and 15 deletions
+16
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);