aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-16 11:33:11 +0200
committerChocobozzz <me@florianbigard.com>2018-05-17 10:55:49 +0200
commit6200d8d91710b03a72a27e35cbe6eed1e6cc8c62 (patch)
treeccd64f46009e45272d1a3426e206438cd5d50d4c /client/src
parenta14d3b6b23816299dba2c5e1010ea8f6eb3d3289 (diff)
downloadPeerTube-6200d8d91710b03a72a27e35cbe6eed1e6cc8c62.tar.gz
PeerTube-6200d8d91710b03a72a27e35cbe6eed1e6cc8c62.tar.zst
PeerTube-6200d8d91710b03a72a27e35cbe6eed1e6cc8c62.zip
Fix video channel update with an admin account
Diffstat (limited to 'client/src')
-rw-r--r--client/src/app/videos/+video-edit/video-add.component.ts1
-rw-r--r--client/src/app/videos/+video-edit/video-update.component.ts20
2 files changed, 14 insertions, 7 deletions
diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts
index 41d14573c..032504cea 100644
--- a/client/src/app/videos/+video-edit/video-add.component.ts
+++ b/client/src/app/videos/+video-edit/video-add.component.ts
@@ -219,7 +219,6 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy
219 219
220 const video = new VideoEdit() 220 const video = new VideoEdit()
221 video.patch(this.form.value) 221 video.patch(this.form.value)
222 video.channelId = this.firstStepChannelId
223 video.id = this.videoUploadedIds.id 222 video.id = this.videoUploadedIds.id
224 video.uuid = this.videoUploadedIds.uuid 223 video.uuid = this.videoUploadedIds.uuid
225 224
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) {