Move boolean and float parsing to shared utils
This commit is contained in:
parent
5238888ecf
commit
f32538ace4
5 changed files with 48 additions and 50 deletions
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
|
||||
import { Events } from 'jellyfin-apiclient';
|
||||
import { toFloat } from '../../../../scripts/stringUtils';
|
||||
import Settings from '../Settings';
|
||||
import TimeSyncServer from './TimeSyncServer';
|
||||
|
||||
|
@ -26,7 +27,7 @@ class TimeSyncCore {
|
|||
this.timeSyncServer = null;
|
||||
|
||||
this.timeSyncDeviceId = Settings.get('timeSyncDevice') || 'server';
|
||||
this.extraTimeOffset = Settings.getFloat('extraTimeOffset', 0.0);
|
||||
this.extraTimeOffset = toFloat(Settings.get('extraTimeOffset'), 0.0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -47,7 +48,7 @@ class TimeSyncCore {
|
|||
});
|
||||
|
||||
Events.on(Settings, 'extraTimeOffset', () => {
|
||||
this.extraTimeOffset = Settings.getFloat('extraTimeOffset', 0.0);
|
||||
this.extraTimeOffset = toFloat(Settings.get('extraTimeOffset'), 0.0);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue