aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-edit/video-update.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos/+video-edit/video-update.component.ts')
-rw-r--r--client/src/app/videos/+video-edit/video-update.component.ts26
1 files changed, 23 insertions, 3 deletions
diff --git a/client/src/app/videos/+video-edit/video-update.component.ts b/client/src/app/videos/+video-edit/video-update.component.ts
index 7f41b56d8..ad6452835 100644
--- a/client/src/app/videos/+video-edit/video-update.component.ts
+++ b/client/src/app/videos/+video-edit/video-update.component.ts
@@ -48,11 +48,10 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
48 this.buildForm() 48 this.buildForm()
49 49
50 this.serverService.videoPrivaciesLoaded 50 this.serverService.videoPrivaciesLoaded
51 .subscribe( 51 .subscribe(() => this.videoPrivacies = this.serverService.getVideoPrivacies())
52 () => this.videoPrivacies = this.serverService.getVideoPrivacies()
53 )
54 52
55 populateAsyncUserVideoChannels(this.authService, this.userVideoChannels) 53 populateAsyncUserVideoChannels(this.authService, this.userVideoChannels)
54 .catch(err => console.error('Cannot populate async user video channels.', err))
56 55
57 const uuid: string = this.route.snapshot.params['uuid'] 56 const uuid: string = this.route.snapshot.params['uuid']
58 this.videoService.getVideo(uuid) 57 this.videoService.getVideo(uuid)
@@ -116,5 +115,26 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
116 115
117 private hydrateFormFromVideo () { 116 private hydrateFormFromVideo () {
118 this.form.patchValue(this.video.toJSON()) 117 this.form.patchValue(this.video.toJSON())
118
119 const objects = [
120 {
121 url: 'thumbnailUrl',
122 name: 'thumbnailfile'
123 },
124 {
125 url: 'previewUrl',
126 name: 'previewfile'
127 }
128 ]
129
130 for (const obj of objects) {
131 fetch(this.video[obj.url])
132 .then(response => response.blob())
133 .then(data => {
134 this.form.patchValue({
135 [ obj.name ]: data
136 })
137 })
138 }
119 } 139 }
120} 140}