aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-edit/shared/video-edit.component.ts
diff options
context:
space:
mode:
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.ts18
1 files changed, 10 insertions, 8 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 be3bbe9be..31dbe43e6 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
@@ -56,7 +56,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
56 @Input() videoToUpdate: VideoDetails 56 @Input() videoToUpdate: VideoDetails
57 57
58 @Input() userVideoChannels: SelectChannelItem[] = [] 58 @Input() userVideoChannels: SelectChannelItem[] = []
59 @Input() schedulePublicationPossible = true 59 @Input() forbidScheduledPublication = true
60 60
61 @Input() videoCaptions: (VideoCaptionEdit & { captionPath?: string })[] = [] 61 @Input() videoCaptions: (VideoCaptionEdit & { captionPath?: string })[] = []
62 62
@@ -198,13 +198,15 @@ export class VideoEditComponent implements OnInit, OnDestroy {
198 .subscribe(privacies => { 198 .subscribe(privacies => {
199 this.videoPrivacies = this.videoService.explainedPrivacyLabels(privacies).videoPrivacies 199 this.videoPrivacies = this.videoService.explainedPrivacyLabels(privacies).videoPrivacies
200 200
201 if (this.schedulePublicationPossible) { 201 // Can't schedule publication if private privacy is not available (could be deleted by a plugin)
202 this.videoPrivacies.push({ 202 const hasPrivatePrivacy = this.videoPrivacies.some(p => p.id === VideoPrivacy.PRIVATE)
203 id: this.SPECIAL_SCHEDULED_PRIVACY, 203 if (this.forbidScheduledPublication || !hasPrivatePrivacy) return
204 label: $localize`Scheduled`, 204
205 description: $localize`Hide the video until a specific date` 205 this.videoPrivacies.push({
206 }) 206 id: this.SPECIAL_SCHEDULED_PRIVACY,
207 } 207 label: $localize`Scheduled`,
208 description: $localize`Hide the video until a specific date`
209 })
208 }) 210 })
209 211
210 this.initialVideoCaptions = this.videoCaptions.map(c => c.language.id) 212 this.initialVideoCaptions = this.videoCaptions.map(c => c.language.id)