aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos')
-rw-r--r--client/src/app/videos/+video-edit/shared/video-edit.component.ts8
-rw-r--r--client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts3
-rw-r--r--client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts3
-rw-r--r--client/src/app/videos/+video-edit/video-add-components/video-send.ts2
-rw-r--r--client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts2
-rw-r--r--client/src/app/videos/+video-edit/video-update.component.ts6
6 files changed, 17 insertions, 7 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 b394a13e4..eb9396d70 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
@@ -12,7 +12,7 @@ import { VideoCaptionService } from '@app/shared/video-caption'
12import { VideoCaptionAddModalComponent } from '@app/videos/+video-edit/shared/video-caption-add-modal.component' 12import { VideoCaptionAddModalComponent } from '@app/videos/+video-edit/shared/video-caption-add-modal.component'
13import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' 13import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model'
14import { removeElementFromArray } from '@app/shared/misc/utils' 14import { removeElementFromArray } from '@app/shared/misc/utils'
15import { VideoConstant } from '../../../../../../shared' 15import { VideoConstant, VideoPrivacy } from '../../../../../../shared'
16 16
17@Component({ 17@Component({
18 selector: 'my-video-edit', 18 selector: 'my-video-edit',
@@ -23,7 +23,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
23 @Input() form: FormGroup 23 @Input() form: FormGroup
24 @Input() formErrors: { [ id: string ]: string } = {} 24 @Input() formErrors: { [ id: string ]: string } = {}
25 @Input() validationMessages: FormReactiveValidationMessages = {} 25 @Input() validationMessages: FormReactiveValidationMessages = {}
26 @Input() videoPrivacies: { id: number, label: string }[] = [] 26 @Input() videoPrivacies: VideoConstant<VideoPrivacy>[] = []
27 @Input() userVideoChannels: { id: number, label: string, support: string }[] = [] 27 @Input() userVideoChannels: { id: number, label: string, support: string }[] = []
28 @Input() schedulePublicationPossible = true 28 @Input() schedulePublicationPossible = true
29 @Input() videoCaptions: VideoCaptionEdit[] = [] 29 @Input() videoCaptions: VideoCaptionEdit[] = []
@@ -33,8 +33,8 @@ export class VideoEditComponent implements OnInit, OnDestroy {
33 // So that it can be accessed in the template 33 // So that it can be accessed in the template
34 readonly SPECIAL_SCHEDULED_PRIVACY = VideoEdit.SPECIAL_SCHEDULED_PRIVACY 34 readonly SPECIAL_SCHEDULED_PRIVACY = VideoEdit.SPECIAL_SCHEDULED_PRIVACY
35 35
36 videoCategories: VideoConstant<string>[] = [] 36 videoCategories: VideoConstant<number>[] = []
37 videoLicences: VideoConstant<string>[] = [] 37 videoLicences: VideoConstant<number>[] = []
38 videoLanguages: VideoConstant<string>[] = [] 38 videoLanguages: VideoConstant<string>[] = []
39 39
40 tagValidators: ValidatorFn[] 40 tagValidators: ValidatorFn[]
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts
index 9623c2bf4..0f7184ff8 100644
--- a/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts
+++ b/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts
@@ -95,6 +95,9 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Ca
95 thumbnailUrl: null, 95 thumbnailUrl: null,
96 previewUrl: null 96 previewUrl: null
97 })) 97 }))
98
99 this.videoPrivacies = this.videoService.explainedPrivacyLabels(this.videoPrivacies)
100
98 this.hydrateFormFromVideo() 101 this.hydrateFormFromVideo()
99 }, 102 },
100 103
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts
index 97b402bfe..031e557ed 100644
--- a/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts
+++ b/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts
@@ -87,6 +87,9 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom
87 thumbnailUrl: null, 87 thumbnailUrl: null,
88 previewUrl: null 88 previewUrl: null
89 })) 89 }))
90
91 this.videoPrivacies = this.videoService.explainedPrivacyLabels(this.videoPrivacies)
92
90 this.hydrateFormFromVideo() 93 this.hydrateFormFromVideo()
91 }, 94 },
92 95
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-send.ts b/client/src/app/videos/+video-edit/video-add-components/video-send.ts
index efd182269..bfe588676 100644
--- a/client/src/app/videos/+video-edit/video-add-components/video-send.ts
+++ b/client/src/app/videos/+video-edit/video-add-components/video-send.ts
@@ -15,7 +15,7 @@ import { populateAsyncUserVideoChannels } from '@app/shared/misc/utils'
15export abstract class VideoSend extends FormReactive implements OnInit, CanComponentDeactivate { 15export abstract class VideoSend extends FormReactive implements OnInit, CanComponentDeactivate {
16 16
17 userVideoChannels: { id: number, label: string, support: string }[] = [] 17 userVideoChannels: { id: number, label: string, support: string }[] = []
18 videoPrivacies: VideoConstant<string>[] = [] 18 videoPrivacies: VideoConstant<VideoPrivacy>[] = []
19 videoCaptions: VideoCaptionEdit[] = [] 19 videoCaptions: VideoCaptionEdit[] = []
20 20
21 firstStepPrivacyId = 0 21 firstStepPrivacyId = 0
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts
index b59fb7335..f9af1655b 100644
--- a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts
+++ b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts
@@ -182,6 +182,8 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
182 channelId 182 channelId
183 }) 183 })
184 184
185 this.videoPrivacies = this.videoService.explainedPrivacyLabels(this.videoPrivacies)
186
185 this.videoUploadObservable = this.videoService.uploadVideo(formData).subscribe( 187 this.videoUploadObservable = this.videoService.uploadVideo(formData).subscribe(
186 event => { 188 event => {
187 if (event.type === HttpEventType.UploadProgress) { 189 if (event.type === HttpEventType.UploadProgress) {
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 0c60e3439..75b11f46c 100644
--- a/client/src/app/videos/+video-edit/video-update.component.ts
+++ b/client/src/app/videos/+video-edit/video-update.component.ts
@@ -24,7 +24,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
24 video: VideoEdit 24 video: VideoEdit
25 25
26 isUpdatingVideo = false 26 isUpdatingVideo = false
27 videoPrivacies: VideoConstant<string>[] = [] 27 videoPrivacies: VideoConstant<VideoPrivacy>[] = []
28 userVideoChannels: { id: number, label: string, support: string }[] = [] 28 userVideoChannels: { id: number, label: string, support: string }[] = []
29 schedulePublicationPossible = false 29 schedulePublicationPossible = false
30 videoCaptions: VideoCaptionEdit[] = [] 30 videoCaptions: VideoCaptionEdit[] = []
@@ -62,11 +62,13 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
62 62
63 // We cannot set private a video that was not private 63 // We cannot set private a video that was not private
64 if (this.video.privacy !== VideoPrivacy.PRIVATE) { 64 if (this.video.privacy !== VideoPrivacy.PRIVATE) {
65 this.videoPrivacies = this.videoPrivacies.filter(p => p.id.toString() !== VideoPrivacy.PRIVATE.toString()) 65 this.videoPrivacies = this.videoPrivacies.filter(p => p.id !== VideoPrivacy.PRIVATE)
66 } else { // We can schedule video publication only if it it is private 66 } else { // We can schedule video publication only if it it is private
67 this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE 67 this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE
68 } 68 }
69 69
70 this.videoPrivacies = this.videoService.explainedPrivacyLabels(this.videoPrivacies)
71
70 // FIXME: Angular does not detect the change inside this subscription, so use the patched setTimeout 72 // FIXME: Angular does not detect the change inside this subscription, so use the patched setTimeout
71 setTimeout(() => this.hydrateFormFromVideo()) 73 setTimeout(() => this.hydrateFormFromVideo())
72 }, 74 },