mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-14 21:26:15 -08:00
fix(settings): init settings issue
This commit is contained in:
1 parent
68f07347c6
commit
6ad1aab104
1 file changed
+15
-17
@@ -128,23 +128,21 @@ export class SettingsComponent implements OnInit {
|
||||
.getValueFromLocalStorage(STORE_KEY.Settings)
|
||||
.subscribe((settings: Settings) => {
|
||||
if (settings) {
|
||||
this.settingsForm.setValue({
|
||||
player: settings.player
|
||||
? settings.player
|
||||
: VideoPlayer.VideoJs,
|
||||
...(this.isElectron ? { epgUrl: [] } : {}),
|
||||
language: settings.language
|
||||
? settings.language
|
||||
: Language.ENGLISH,
|
||||
showCaptions: settings.showCaptions
|
||||
? settings.showCaptions
|
||||
: false,
|
||||
theme: settings.theme
|
||||
? settings.theme
|
||||
: Theme.LightTheme,
|
||||
mpvPlayerPath: settings.mpvPlayerPath,
|
||||
vlcPlayerPath: settings.vlcPlayerPath,
|
||||
});
|
||||
try {
|
||||
this.settingsForm.setValue({
|
||||
player: settings.player
|
||||
? settings.player
|
||||
: VideoPlayer.VideoJs,
|
||||
...(this.isElectron ? { epgUrl: [] } : {}),
|
||||
language: settings.language ?? Language.ENGLISH,
|
||||
showCaptions: settings.showCaptions ?? false,
|
||||
theme: settings.theme ?? Theme.LightTheme,
|
||||
mpvPlayerPath: settings.mpvPlayerPath ?? '',
|
||||
vlcPlayerPath: settings.vlcPlayerPath ?? '',
|
||||
});
|
||||
} catch (error) {
|
||||
throw new Error(error);
|
||||
}
|
||||
|
||||
if (this.isElectron) {
|
||||
this.setEpgUrls(settings.epgUrl);
|
||||
|
||||
Reference in new issue
Block a user