mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update variable declerations for appSettings and userSettings
This commit is contained in:
parent
f296eb3475
commit
0473e549ab
2 changed files with 14 additions and 14 deletions
|
@ -2,7 +2,7 @@ import appSettings from 'appSettings';
|
|||
import events from 'events';
|
||||
|
||||
function onSaveTimeout() {
|
||||
var self = this;
|
||||
const self = this;
|
||||
self.saveTimeout = null;
|
||||
self.currentApiClient.updateDisplayPreferences('usersettings', self.displayPrefs, self.currentUserId, 'emby');
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ export class UserSettings {
|
|||
return Promise.resolve();
|
||||
}
|
||||
|
||||
var self = this;
|
||||
const self = this;
|
||||
|
||||
return apiClient.getDisplayPreferences('usersettings', userId, 'emby').then(function (result) {
|
||||
result.CustomPrefs = result.CustomPrefs || {};
|
||||
|
@ -63,9 +63,9 @@ export class UserSettings {
|
|||
* @param {boolean} enableOnServer - Flag to save preferences on server.
|
||||
*/
|
||||
set(name, value, enableOnServer) {
|
||||
var userId = this.currentUserId;
|
||||
var currentValue = this.get(name, enableOnServer);
|
||||
var result = appSettings.set(name, value, userId);
|
||||
const userId = this.currentUserId;
|
||||
const currentValue = this.get(name, enableOnServer);
|
||||
const result = appSettings.set(name, value, userId);
|
||||
|
||||
if (enableOnServer !== false && this.displayPrefs) {
|
||||
this.displayPrefs.CustomPrefs[name] = value == null ? value : value.toString();
|
||||
|
@ -86,7 +86,7 @@ export class UserSettings {
|
|||
* @return {string} Value of setting.
|
||||
*/
|
||||
get(name, enableOnServer) {
|
||||
var userId = this.currentUserId;
|
||||
const userId = this.currentUserId;
|
||||
if (enableOnServer !== false && this.displayPrefs) {
|
||||
return this.displayPrefs.CustomPrefs[name];
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ export class UserSettings {
|
|||
* @return {Object|Promise} Configuration or Promise.
|
||||
*/
|
||||
serverConfig(config) {
|
||||
var apiClient = this.currentApiClient;
|
||||
const apiClient = this.currentApiClient;
|
||||
if (config) {
|
||||
return apiClient.updateUserConfiguration(this.currentUserId, config);
|
||||
}
|
||||
|
@ -349,7 +349,7 @@ export class UserSettings {
|
|||
return this.set('libraryPageSize', parseInt(val, 10), false);
|
||||
}
|
||||
|
||||
var libraryPageSize = parseInt(this.get('libraryPageSize', false), 10);
|
||||
const libraryPageSize = parseInt(this.get('libraryPageSize', false), 10);
|
||||
if (libraryPageSize === 0) {
|
||||
// Explicitly return 0 to avoid returning 100 because 0 is falsy.
|
||||
return 0;
|
||||
|
@ -378,7 +378,7 @@ export class UserSettings {
|
|||
* @return {Object} Query.
|
||||
*/
|
||||
loadQuerySettings(key, query) {
|
||||
var values = this.get(key);
|
||||
let values = this.get(key);
|
||||
if (values) {
|
||||
values = JSON.parse(values);
|
||||
return Object.assign(query, values);
|
||||
|
@ -393,7 +393,7 @@ export class UserSettings {
|
|||
* @param {Object} query - Query.
|
||||
*/
|
||||
saveQuerySettings(key, query) {
|
||||
var values = {};
|
||||
const values = {};
|
||||
if (query.SortBy) {
|
||||
values.SortBy = query.SortBy;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue