mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Added getSortOptions to userSettings.js and cleaned up the shortcuts.js and list.js to use the above method
This commit is contained in:
parent
f922742d86
commit
580ad5f1a8
3 changed files with 18 additions and 16 deletions
|
@ -622,6 +622,18 @@ export class UserSettings {
|
|||
getFilter(key) {
|
||||
return this.get(key, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current sort values
|
||||
* @param {string} key - Filter key.
|
||||
* @return {Object} sortOptions object
|
||||
*/
|
||||
getSortValues(key) {
|
||||
return {
|
||||
sortBy: this.getFilter(key + '-sortby'),
|
||||
sortOrder: this.getFilter(key + '-sortorder') === 'Descending' ? 'Descending' : 'Ascending'
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export const currentSettings = new UserSettings;
|
||||
|
@ -672,3 +684,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 getSortValues = currentSettings.getSortValues.bind(currentSettings);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue