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

Save filtering and sort fields only

This commit is contained in:
viown 2024-10-29 12:07:18 +03:00
parent 6f7ece6592
commit 18ea570ea1

View file

@ -538,9 +538,21 @@ export class UserSettings {
* @param {Object} query - Query.
*/
saveQuerySettings(key, query) {
const newQuery = { ...query };
delete newQuery.NameStartsWith;
delete newQuery.NameLessThan;
const allowedFields = [
'SortBy', 'SortOrder', 'Filters', 'HasSubtitles',
'HasTrailer', 'HasSpecialFeature', 'HasThemeSong',
'HasThemeVideo', 'Genres', 'OfficialRatings',
'Tags', 'VideoTypes', 'IsHD', 'Is4K', 'Is3D',
'Years'
];
const newQuery = Object.keys(query)
.filter(field => allowedFields.includes(field))
.reduce((acc, field) => {
acc[field] = query[field];
return acc;
}, {});
return this.set(key, JSON.stringify(newQuery));
}