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

cleanup duplicate userSettings from libraryBrowser

This commit is contained in:
grafixeyehero 2023-07-14 21:32:34 +03:00
parent d8c25b4594
commit 1825b821af
15 changed files with 147 additions and 196 deletions

View file

@ -1,43 +1,5 @@
import * as userSettings from './settings/userSettings';
import globalize from './globalize';
export function getSavedQueryKey(modifier) {
return window.location.href.split('#')[0] + (modifier || '');
}
export function loadSavedQueryValues(key, query) {
let values = userSettings.get(key);
if (values) {
values = JSON.parse(values);
return Object.assign(query, values);
}
return query;
}
export function saveQueryValues(key, query) {
const values = {};
if (query.SortBy) {
values.SortBy = query.SortBy;
}
if (query.SortOrder) {
values.SortOrder = query.SortOrder;
}
userSettings.set(key, JSON.stringify(values));
}
export function saveViewSetting (key, value) {
userSettings.set(key + '-_view', value);
}
export function getSavedView (key) {
return userSettings.get(key + '-_view');
}
export function showLayoutMenu (button, currentLayout, views) {
let dispatchEvent = true;
@ -204,11 +166,6 @@ export function showSortMenu (options) {
}
const libraryBrowser = {
getSavedQueryKey,
loadSavedQueryValues,
saveQueryValues,
saveViewSetting,
getSavedView,
showLayoutMenu,
getQueryPagingHtml,
showSortMenu