aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-edit/shared/video-edit.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-12-18 15:31:54 +0100
committerChocobozzz <me@florianbigard.com>2019-12-18 15:40:59 +0100
commitba430d7516bc5b1324b60571ba7594460969b7fb (patch)
treedf5c6952c82f49a94c0a884bbc97d4a0cbd9f867 /client/src/app/videos/+video-edit/shared/video-edit.component.ts
parent5dfb7c1dec8222b0bbccac5b56ad46da1438747e (diff)
downloadPeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.tar.gz
PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.tar.zst
PeerTube-ba430d7516bc5b1324b60571ba7594460969b7fb.zip
Lazy load static objects
Diffstat (limited to 'client/src/app/videos/+video-edit/shared/video-edit.component.ts')
-rw-r--r--client/src/app/videos/+video-edit/shared/video-edit.component.ts21
1 files changed, 15 insertions, 6 deletions
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.ts b/client/src/app/videos/+video-edit/shared/video-edit.component.ts
index d0d5e2a2b..982e071ad 100644
--- a/client/src/app/videos/+video-edit/shared/video-edit.component.ts
+++ b/client/src/app/videos/+video-edit/shared/video-edit.component.ts
@@ -12,7 +12,7 @@ import { VideoCaptionService } from '@app/shared/video-caption'
12import { VideoCaptionAddModalComponent } from '@app/videos/+video-edit/shared/video-caption-add-modal.component' 12import { VideoCaptionAddModalComponent } from '@app/videos/+video-edit/shared/video-caption-add-modal.component'
13import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' 13import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model'
14import { removeElementFromArray } from '@app/shared/misc/utils' 14import { removeElementFromArray } from '@app/shared/misc/utils'
15import { VideoConstant, VideoPrivacy } from '../../../../../../shared' 15import { ServerConfig, VideoConstant, VideoPrivacy } from '../../../../../../shared'
16import { VideoService } from '@app/shared/video/video.service' 16import { VideoService } from '@app/shared/video/video.service'
17 17
18@Component({ 18@Component({
@@ -51,6 +51,8 @@ export class VideoEditComponent implements OnInit, OnDestroy {
51 calendarTimezone: string 51 calendarTimezone: string
52 calendarDateFormat: string 52 calendarDateFormat: string
53 53
54 serverConfig: ServerConfig
55
54 private schedulerInterval: any 56 private schedulerInterval: any
55 private firstPatchDone = false 57 private firstPatchDone = false
56 private initialVideoCaptions: string[] = [] 58 private initialVideoCaptions: string[] = []
@@ -130,12 +132,19 @@ export class VideoEditComponent implements OnInit, OnDestroy {
130 ngOnInit () { 132 ngOnInit () {
131 this.updateForm() 133 this.updateForm()
132 134
133 this.videoCategories = this.serverService.getVideoCategories() 135 this.serverService.getVideoCategories()
134 this.videoLicences = this.serverService.getVideoLicences() 136 .subscribe(res => this.videoCategories = res)
135 this.videoLanguages = this.serverService.getVideoLanguages() 137 this.serverService.getVideoLicences()
138 .subscribe(res => this.videoLicences = res)
139 this.serverService.getVideoLanguages()
140 .subscribe(res => this.videoLanguages = res)
141
142 this.serverService.getVideoPrivacies()
143 .subscribe(privacies => this.videoPrivacies = this.videoService.explainedPrivacyLabels(privacies))
136 144
137 const privacies = this.serverService.getVideoPrivacies() 145 this.serverConfig = this.serverService.getTmpConfig()
138 this.videoPrivacies = this.videoService.explainedPrivacyLabels(privacies) 146 this.serverService.getConfig()
147 .subscribe(config => this.serverConfig = config)
139 148
140 this.initialVideoCaptions = this.videoCaptions.map(c => c.language.id) 149 this.initialVideoCaptions = this.videoCaptions.map(c => c.language.id)
141 150