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

Use toBoolean from string utils

This commit is contained in:
Bill Thornton 2022-04-12 12:18:12 -04:00
parent 92d249354c
commit 9de11b443d
5 changed files with 26 additions and 33 deletions

View file

@ -1,5 +1,5 @@
/* eslint-disable indent */
import { AppStorage, Events } from 'jellyfin-apiclient';
import { toBoolean } from '../../utils/string.ts';
class AppSettings {
#getKey(name, userId) {
@ -15,7 +15,7 @@ class AppSettings {
this.set('enableAutoLogin', val.toString());
}
return this.get('enableAutoLogin') !== 'false';
return toBoolean(this.get('enableAutoLogin'), true);
}
/**
@ -28,7 +28,7 @@ class AppSettings {
return this.set('enableGamepad', val.toString());
}
return this.get('enableGamepad') === 'true';
return toBoolean(this.get('enableGamepad'), false);
}
enableSystemExternalPlayers(val) {
@ -36,7 +36,7 @@ class AppSettings {
this.set('enableSystemExternalPlayers', val.toString());
}
return this.get('enableSystemExternalPlayers') === 'true';
return toBoolean(this.get('enableSystemExternalPlayers'), false);
}
enableAutomaticBitrateDetection(isInNetwork, mediaType, val) {
@ -52,7 +52,7 @@ class AppSettings {
if (isInNetwork && mediaType === 'Audio') {
return true;
} else {
return this.get(key) !== 'false';
return toBoolean(this.get(key), true);
}
}
@ -106,6 +106,4 @@ class AppSettings {
}
}
/* eslint-enable indent */
export default new AppSettings();