aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-edit/video-update.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-15 16:52:15 +0200
committerChocobozzz <me@florianbigard.com>2018-06-15 18:20:56 +0200
commitbbe0f0645ca958d33a3f409b15166609733b663f (patch)
treeedcd5d702c73cda74a2177c4bdc08c616334337d /client/src/app/videos/+video-edit/video-update.component.ts
parent2baea0c77cc765f7cbca9c9a2f4272268892a35c (diff)
downloadPeerTube-bbe0f0645ca958d33a3f409b15166609733b663f.tar.gz
PeerTube-bbe0f0645ca958d33a3f409b15166609733b663f.tar.zst
PeerTube-bbe0f0645ca958d33a3f409b15166609733b663f.zip
Add ability to schedule video publication
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.ts14
1 files changed, 6 insertions, 8 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 0266164af..c4e6f44de 100644
--- a/client/src/app/videos/+video-edit/video-update.component.ts
+++ b/client/src/app/videos/+video-edit/video-update.component.ts
@@ -24,6 +24,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
24 isUpdatingVideo = false 24 isUpdatingVideo = false
25 videoPrivacies = [] 25 videoPrivacies = []
26 userVideoChannels = [] 26 userVideoChannels = []
27 schedulePublicationPossible = false
27 28
28 constructor ( 29 constructor (
29 protected formValidatorService: FormValidatorService, 30 protected formValidatorService: FormValidatorService,
@@ -70,13 +71,10 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
70 this.userVideoChannels = videoChannels 71 this.userVideoChannels = videoChannels
71 72
72 // We cannot set private a video that was not private 73 // We cannot set private a video that was not private
73 if (video.privacy.id !== VideoPrivacy.PRIVATE) { 74 if (this.video.privacy !== VideoPrivacy.PRIVATE) {
74 const newVideoPrivacies = [] 75 this.videoPrivacies = this.videoPrivacies.filter(p => p.id !== VideoPrivacy.PRIVATE)
75 for (const p of this.videoPrivacies) { 76 } else { // We can schedule video publication only if it it is private
76 if (p.id !== VideoPrivacy.PRIVATE) newVideoPrivacies.push(p) 77 this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE
77 }
78
79 this.videoPrivacies = newVideoPrivacies
80 } 78 }
81 79
82 this.hydrateFormFromVideo() 80 this.hydrateFormFromVideo()
@@ -123,7 +121,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
123 } 121 }
124 122
125 private hydrateFormFromVideo () { 123 private hydrateFormFromVideo () {
126 this.form.patchValue(this.video.toJSON()) 124 this.form.patchValue(this.video.toFormPatch())
127 125
128 const objects = [ 126 const objects = [
129 { 127 {