- forkJoin([
- this.serverService.getVideoLanguages(),
- this.serverService.getConfig(),
- this.userInformationLoaded.pipe(first())
- ]).subscribe(([ languages, config ]) => {
- const group = this.allLanguagesGroup
-
- this.languageItems = [ { label: $localize`Unknown language`, id: '_unknown', group } ]
- this.languageItems = this.languageItems
- .concat(languages.map(l => ({ label: l.label, id: l.id, group })))
-
- const videoLanguages: ItemSelectCheckboxValue[] = this.user.videoLanguages
- ? this.user.videoLanguages.map(l => ({ id: l }))
- : [ { group } ]
-
- this.defaultNSFWPolicy = config.instance.defaultNSFWPolicy
-
- this.form.patchValue({
- nsfwPolicy: this.user.nsfwPolicy || this.defaultNSFWPolicy,
- webTorrentEnabled: this.user.webTorrentEnabled,
- autoPlayVideo: this.user.autoPlayVideo === true,
- autoPlayNextVideo: this.user.autoPlayNextVideo,
- videoLanguages
- })
-
- if (this.reactiveUpdate) this.handleReactiveUpdate()
- })
+ this.userInformationLoaded.pipe(first())
+ .subscribe(
+ () => {
+ const serverConfig = this.serverService.getHTMLConfig()
+ this.defaultNSFWPolicy = serverConfig.instance.defaultNSFWPolicy
+
+ this.form.patchValue({
+ nsfwPolicy: this.user.nsfwPolicy || this.defaultNSFWPolicy,
+ p2pEnabled: this.user.p2pEnabled,
+ autoPlayVideo: this.user.autoPlayVideo === true,
+ autoPlayNextVideo: this.user.autoPlayNextVideo,
+ videoLanguages: this.user.videoLanguages
+ })
+
+ if (this.reactiveUpdate) this.handleReactiveUpdate()
+ }
+ )