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:
parent
6f7ece6592
commit
18ea570ea1
1 changed files with 15 additions and 3 deletions
|
@ -538,9 +538,21 @@ export class UserSettings {
|
||||||
* @param {Object} query - Query.
|
* @param {Object} query - Query.
|
||||||
*/
|
*/
|
||||||
saveQuerySettings(key, query) {
|
saveQuerySettings(key, query) {
|
||||||
const newQuery = { ...query };
|
const allowedFields = [
|
||||||
delete newQuery.NameStartsWith;
|
'SortBy', 'SortOrder', 'Filters', 'HasSubtitles',
|
||||||
delete newQuery.NameLessThan;
|
'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));
|
return this.set(key, JSON.stringify(newQuery));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue