diff options
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.ts | 16 |
1 files changed, 2 insertions, 14 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 10f797d02..81c66ff20 100644 --- a/client/src/app/videos/+video-edit/video-update.component.ts +++ b/client/src/app/videos/+video-edit/video-update.component.ts | |||
@@ -3,7 +3,6 @@ import { Component, HostListener, OnInit } from '@angular/core' | |||
3 | import { ActivatedRoute, Router } from '@angular/router' | 3 | import { ActivatedRoute, Router } from '@angular/router' |
4 | import { LoadingBarService } from '@ngx-loading-bar/core' | 4 | import { LoadingBarService } from '@ngx-loading-bar/core' |
5 | import { Notifier } from '@app/core' | 5 | import { Notifier } from '@app/core' |
6 | import { VideoConstant, VideoPrivacy } from '../../../../../shared/models/videos' | ||
7 | import { ServerService } from '../../core' | 6 | import { ServerService } from '../../core' |
8 | import { FormReactive } from '../../shared' | 7 | import { FormReactive } from '../../shared' |
9 | import { VideoEdit } from '../../shared/video/video-edit.model' | 8 | import { VideoEdit } from '../../shared/video/video-edit.model' |
@@ -13,6 +12,7 @@ import { FormValidatorService } from '@app/shared/forms/form-validators/form-val | |||
13 | import { VideoCaptionService } from '@app/shared/video-caption' | 12 | import { VideoCaptionService } from '@app/shared/video-caption' |
14 | import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' | 13 | import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' |
15 | import { VideoDetails } from '@app/shared/video/video-details.model' | 14 | import { VideoDetails } from '@app/shared/video/video-details.model' |
15 | import { VideoPrivacy } from '@shared/models' | ||
16 | 16 | ||
17 | @Component({ | 17 | @Component({ |
18 | selector: 'my-videos-update', | 18 | selector: 'my-videos-update', |
@@ -23,8 +23,6 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
23 | video: VideoEdit | 23 | video: VideoEdit |
24 | 24 | ||
25 | isUpdatingVideo = false | 25 | isUpdatingVideo = false |
26 | videoPrivacies: VideoConstant<VideoPrivacy>[] = [] | ||
27 | explainedVideoPrivacies: VideoConstant<VideoPrivacy>[] = [] | ||
28 | userVideoChannels: { id: number, label: string, support: string }[] = [] | 26 | userVideoChannels: { id: number, label: string, support: string }[] = [] |
29 | schedulePublicationPossible = false | 27 | schedulePublicationPossible = false |
30 | videoCaptions: VideoCaptionEdit[] = [] | 28 | videoCaptions: VideoCaptionEdit[] = [] |
@@ -49,9 +47,6 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
49 | ngOnInit () { | 47 | ngOnInit () { |
50 | this.buildForm({}) | 48 | this.buildForm({}) |
51 | 49 | ||
52 | this.serverService.videoPrivaciesLoaded | ||
53 | .subscribe(() => this.videoPrivacies = this.serverService.getVideoPrivacies()) | ||
54 | |||
55 | this.route.data | 50 | this.route.data |
56 | .pipe(map(data => data.videoData)) | 51 | .pipe(map(data => data.videoData)) |
57 | .subscribe(({ video, videoChannels, videoCaptions }) => { | 52 | .subscribe(({ video, videoChannels, videoCaptions }) => { |
@@ -59,14 +54,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
59 | this.userVideoChannels = videoChannels | 54 | this.userVideoChannels = videoChannels |
60 | this.videoCaptions = videoCaptions | 55 | this.videoCaptions = videoCaptions |
61 | 56 | ||
62 | // We cannot set private a video that was not private | 57 | this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE |
63 | if (this.video.privacy !== VideoPrivacy.PRIVATE) { | ||
64 | this.videoPrivacies = this.videoPrivacies.filter(p => p.id !== VideoPrivacy.PRIVATE) | ||
65 | } else { // We can schedule video publication only if it it is private | ||
66 | this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE | ||
67 | } | ||
68 | |||
69 | this.explainedVideoPrivacies = this.videoService.explainedPrivacyLabels(this.videoPrivacies) | ||
70 | 58 | ||
71 | const videoFiles = (video as VideoDetails).files | 59 | const videoFiles = (video as VideoDetails).files |
72 | if (videoFiles.length > 1) { // Already transcoded | 60 | if (videoFiles.length > 1) { // Already transcoded |