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.ts20
1 files changed, 14 insertions, 6 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 b1d80bcaa..00c2ed3f1 100644
--- a/client/src/app/videos/+video-edit/video-update.component.ts
+++ b/client/src/app/videos/+video-edit/video-update.component.ts
@@ -11,7 +11,7 @@ import { FormReactive } from '../../shared'
11import { ValidatorMessage } from '../../shared/forms/form-validators/validator-message' 11import { ValidatorMessage } from '../../shared/forms/form-validators/validator-message'
12import { VideoEdit } from '../../shared/video/video-edit.model' 12import { VideoEdit } from '../../shared/video/video-edit.model'
13import { VideoService } from '../../shared/video/video.service' 13import { VideoService } from '../../shared/video/video.service'
14import { populateAsyncUserVideoChannels } from '@app/shared/misc/utils' 14import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
15 15
16@Component({ 16@Component({
17 selector: 'my-videos-update', 17 selector: 'my-videos-update',
@@ -36,7 +36,8 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
36 private serverService: ServerService, 36 private serverService: ServerService,
37 private videoService: VideoService, 37 private videoService: VideoService,
38 private authService: AuthService, 38 private authService: AuthService,
39 private loadingBar: LoadingBarService 39 private loadingBar: LoadingBarService,
40 private videoChannelService: VideoChannelService
40 ) { 41 ) {
41 super() 42 super()
42 } 43 }
@@ -59,14 +60,21 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
59 return this.videoService 60 return this.videoService
60 .loadCompleteDescription(video.descriptionPath) 61 .loadCompleteDescription(video.descriptionPath)
61 .pipe(map(description => Object.assign(video, { description }))) 62 .pipe(map(description => Object.assign(video, { description })))
63 }),
64 switchMap(video => {
65 return this.videoChannelService
66 .listAccountVideoChannels(video.account.id)
67 .pipe(
68 map(result => result.data),
69 map(videoChannels => videoChannels.map(c => ({ id: c.id, label: c.displayName }))),
70 map(videoChannels => ({ video, videoChannels }))
71 )
62 }) 72 })
63 ) 73 )
64 .subscribe( 74 .subscribe(
65 video => { 75 ({ video, videoChannels }) => {
66 this.video = new VideoEdit(video) 76 this.video = new VideoEdit(video)
67 77 this.userVideoChannels = videoChannels
68 populateAsyncUserVideoChannels(this.authService, this.userVideoChannels)
69 .catch(err => console.error(err))
70 78
71 // We cannot set private a video that was not private 79 // We cannot set private a video that was not private
72 if (video.privacy.id !== VideoPrivacy.PRIVATE) { 80 if (video.privacy.id !== VideoPrivacy.PRIVATE) {