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

Changed from using sortOptions to using already implemented queryOptions

Null verification for parentid on shortcuts.js
itemContextMenu is now obeying to sorting
This commit is contained in:
MrK 2023-09-20 17:44:55 +01:00
parent 580ad5f1a8
commit ee791f9d0d
5 changed files with 70 additions and 47 deletions

View file

@ -624,15 +624,28 @@ export class UserSettings {
}
/**
* Gets the current sort values
* Gets the current sort values (Legacy - Non-JSON)
* (old views such as list.js [Photos] will
* use this one)
* @param {string} key - Filter key.
* @return {Object} sortOptions object
*/
getSortValuesLegacy(key, defaultSortBy) {
return {
sortBy: this.getFilter(key + '-sortby') || defaultSortBy,
sortOrder: this.getFilter(key + '-sortorder') === 'Descending' ? 'Descending' : 'Ascending'
};
}
/**
* Gets the current sort values (JSON)
* (new views such as MoviesView will use
* this one)
* @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'
};
return this.loadQuerySettings(key, {});
}
}
@ -684,4 +697,5 @@ 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);
export const getSortValues = currentSettings.getSortValues.bind(currentSettings);