diff options
Diffstat (limited to 'client/src/app/videos/+video-edit/video-add.component.ts')
-rw-r--r-- | client/src/app/videos/+video-edit/video-add.component.ts | 10 |
1 files changed, 9 insertions, 1 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 5b5557ed9..c8094f792 100644 --- a/client/src/app/videos/+video-edit/video-add.component.ts +++ b/client/src/app/videos/+video-edit/video-add.component.ts | |||
@@ -13,7 +13,8 @@ import { | |||
13 | VIDEO_DESCRIPTION, | 13 | VIDEO_DESCRIPTION, |
14 | VIDEO_TAGS, | 14 | VIDEO_TAGS, |
15 | VIDEO_CHANNEL, | 15 | VIDEO_CHANNEL, |
16 | VIDEO_FILE | 16 | VIDEO_FILE, |
17 | VIDEO_PRIVACY | ||
17 | } from '../../shared' | 18 | } from '../../shared' |
18 | import { AuthService, ServerService } from '../../core' | 19 | import { AuthService, ServerService } from '../../core' |
19 | import { VideoService } from '../shared' | 20 | import { VideoService } from '../shared' |
@@ -34,6 +35,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
34 | videoCategories = [] | 35 | videoCategories = [] |
35 | videoLicences = [] | 36 | videoLicences = [] |
36 | videoLanguages = [] | 37 | videoLanguages = [] |
38 | videoPrivacies = [] | ||
37 | userVideoChannels = [] | 39 | userVideoChannels = [] |
38 | 40 | ||
39 | tagValidators = VIDEO_TAGS.VALIDATORS | 41 | tagValidators = VIDEO_TAGS.VALIDATORS |
@@ -43,6 +45,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
43 | form: FormGroup | 45 | form: FormGroup |
44 | formErrors = { | 46 | formErrors = { |
45 | name: '', | 47 | name: '', |
48 | privacy: '', | ||
46 | category: '', | 49 | category: '', |
47 | licence: '', | 50 | licence: '', |
48 | language: '', | 51 | language: '', |
@@ -52,6 +55,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
52 | } | 55 | } |
53 | validationMessages = { | 56 | validationMessages = { |
54 | name: VIDEO_NAME.MESSAGES, | 57 | name: VIDEO_NAME.MESSAGES, |
58 | privacy: VIDEO_PRIVACY.MESSAGES, | ||
55 | category: VIDEO_CATEGORY.MESSAGES, | 59 | category: VIDEO_CATEGORY.MESSAGES, |
56 | licence: VIDEO_LICENCE.MESSAGES, | 60 | licence: VIDEO_LICENCE.MESSAGES, |
57 | language: VIDEO_LANGUAGE.MESSAGES, | 61 | language: VIDEO_LANGUAGE.MESSAGES, |
@@ -79,6 +83,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
79 | this.form = this.formBuilder.group({ | 83 | this.form = this.formBuilder.group({ |
80 | name: [ '', VIDEO_NAME.VALIDATORS ], | 84 | name: [ '', VIDEO_NAME.VALIDATORS ], |
81 | nsfw: [ false ], | 85 | nsfw: [ false ], |
86 | privacy: [ '', VIDEO_PRIVACY.VALIDATORS ], | ||
82 | category: [ '', VIDEO_CATEGORY.VALIDATORS ], | 87 | category: [ '', VIDEO_CATEGORY.VALIDATORS ], |
83 | licence: [ '', VIDEO_LICENCE.VALIDATORS ], | 88 | licence: [ '', VIDEO_LICENCE.VALIDATORS ], |
84 | language: [ '', VIDEO_LANGUAGE.VALIDATORS ], | 89 | language: [ '', VIDEO_LANGUAGE.VALIDATORS ], |
@@ -95,6 +100,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
95 | this.videoCategories = this.serverService.getVideoCategories() | 100 | this.videoCategories = this.serverService.getVideoCategories() |
96 | this.videoLicences = this.serverService.getVideoLicences() | 101 | this.videoLicences = this.serverService.getVideoLicences() |
97 | this.videoLanguages = this.serverService.getVideoLanguages() | 102 | this.videoLanguages = this.serverService.getVideoLanguages() |
103 | this.videoPrivacies = this.serverService.getVideoPrivacies() | ||
98 | 104 | ||
99 | this.buildForm() | 105 | this.buildForm() |
100 | 106 | ||
@@ -139,6 +145,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
139 | const formValue: VideoCreate = this.form.value | 145 | const formValue: VideoCreate = this.form.value |
140 | 146 | ||
141 | const name = formValue.name | 147 | const name = formValue.name |
148 | const privacy = formValue.privacy | ||
142 | const nsfw = formValue.nsfw | 149 | const nsfw = formValue.nsfw |
143 | const category = formValue.category | 150 | const category = formValue.category |
144 | const licence = formValue.licence | 151 | const licence = formValue.licence |
@@ -150,6 +157,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
150 | 157 | ||
151 | const formData = new FormData() | 158 | const formData = new FormData() |
152 | formData.append('name', name) | 159 | formData.append('name', name) |
160 | formData.append('privacy', privacy.toString()) | ||
153 | formData.append('category', '' + category) | 161 | formData.append('category', '' + category) |
154 | formData.append('nsfw', '' + nsfw) | 162 | formData.append('nsfw', '' + nsfw) |
155 | formData.append('licence', '' + licence) | 163 | formData.append('licence', '' + licence) |