diff --git a/src/scripts/settings/appSettings.js b/src/scripts/settings/appSettings.js index 6f0975e98c..ffd63b9561 100644 --- a/src/scripts/settings/appSettings.js +++ b/src/scripts/settings/appSettings.js @@ -28,7 +28,7 @@ import events from 'events'; } export function enableAutomaticBitrateDetection(isInNetwork, mediaType, val) { - var key = 'enableautobitratebitrate-' + mediaType + '-' + isInNetwork; + const key = 'enableautobitratebitrate-' + mediaType + '-' + isInNetwork; if (val !== undefined) { if (isInNetwork && mediaType === 'Audio') { val = true; @@ -45,7 +45,7 @@ import events from 'events'; } export function maxStreamingBitrate(isInNetwork, mediaType, val) { - var key = 'maxbitrate-' + mediaType + '-' + isInNetwork; + const key = 'maxbitrate-' + mediaType + '-' + isInNetwork; if (val !== undefined) { if (isInNetwork && mediaType === 'Audio') { // nothing to do, this is always a max value @@ -67,7 +67,7 @@ import events from 'events'; this.set('maxStaticMusicBitrate', val); } - var defaultValue = 320000; + const defaultValue = 320000; return parseInt(this.get('maxStaticMusicBitrate') || defaultValue.toString()) || defaultValue; } @@ -118,7 +118,7 @@ import events from 'events'; } export function set(name, value, userId) { - var currentValue = this.get(name, userId); + const currentValue = this.get(name, userId); appStorage.setItem(getKey(name, userId), value); if (currentValue !== value) { diff --git a/src/scripts/settings/userSettings.js b/src/scripts/settings/userSettings.js index 1b5283fa43..bd6050b5fe 100644 --- a/src/scripts/settings/userSettings.js +++ b/src/scripts/settings/userSettings.js @@ -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; }