diff options
Diffstat (limited to 'client/src/app/videos/video-add/video-add.component.ts')
-rw-r--r-- | client/src/app/videos/video-add/video-add.component.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/client/src/app/videos/video-add/video-add.component.ts b/client/src/app/videos/video-add/video-add.component.ts index ea7ad2e5c..da556f48d 100644 --- a/client/src/app/videos/video-add/video-add.component.ts +++ b/client/src/app/videos/video-add/video-add.component.ts | |||
@@ -11,6 +11,7 @@ import { | |||
11 | VIDEO_NAME, | 11 | VIDEO_NAME, |
12 | VIDEO_CATEGORY, | 12 | VIDEO_CATEGORY, |
13 | VIDEO_LICENCE, | 13 | VIDEO_LICENCE, |
14 | VIDEO_LANGUAGE, | ||
14 | VIDEO_DESCRIPTION, | 15 | VIDEO_DESCRIPTION, |
15 | VIDEO_TAGS | 16 | VIDEO_TAGS |
16 | } from '../../shared'; | 17 | } from '../../shared'; |
@@ -27,6 +28,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
27 | uploader: FileUploader; | 28 | uploader: FileUploader; |
28 | videoCategories = []; | 29 | videoCategories = []; |
29 | videoLicences = []; | 30 | videoLicences = []; |
31 | videoLanguages = []; | ||
30 | 32 | ||
31 | error: string = null; | 33 | error: string = null; |
32 | form: FormGroup; | 34 | form: FormGroup; |
@@ -34,6 +36,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
34 | name: '', | 36 | name: '', |
35 | category: '', | 37 | category: '', |
36 | licence: '', | 38 | licence: '', |
39 | language: '', | ||
37 | description: '', | 40 | description: '', |
38 | currentTag: '' | 41 | currentTag: '' |
39 | }; | 42 | }; |
@@ -41,6 +44,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
41 | name: VIDEO_NAME.MESSAGES, | 44 | name: VIDEO_NAME.MESSAGES, |
42 | category: VIDEO_CATEGORY.MESSAGES, | 45 | category: VIDEO_CATEGORY.MESSAGES, |
43 | licence: VIDEO_LICENCE.MESSAGES, | 46 | licence: VIDEO_LICENCE.MESSAGES, |
47 | language: VIDEO_LANGUAGE.MESSAGES, | ||
44 | description: VIDEO_DESCRIPTION.MESSAGES, | 48 | description: VIDEO_DESCRIPTION.MESSAGES, |
45 | currentTag: VIDEO_TAGS.MESSAGES | 49 | currentTag: VIDEO_TAGS.MESSAGES |
46 | }; | 50 | }; |
@@ -74,6 +78,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
74 | nsfw: [ false ], | 78 | nsfw: [ false ], |
75 | category: [ '', VIDEO_CATEGORY.VALIDATORS ], | 79 | category: [ '', VIDEO_CATEGORY.VALIDATORS ], |
76 | licence: [ '', VIDEO_LICENCE.VALIDATORS ], | 80 | licence: [ '', VIDEO_LICENCE.VALIDATORS ], |
81 | language: [ '', VIDEO_LANGUAGE.VALIDATORS ], | ||
77 | description: [ '', VIDEO_DESCRIPTION.VALIDATORS ], | 82 | description: [ '', VIDEO_DESCRIPTION.VALIDATORS ], |
78 | currentTag: [ '', VIDEO_TAGS.VALIDATORS ] | 83 | currentTag: [ '', VIDEO_TAGS.VALIDATORS ] |
79 | }); | 84 | }); |
@@ -84,6 +89,7 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
84 | ngOnInit() { | 89 | ngOnInit() { |
85 | this.videoCategories = this.videoService.videoCategories; | 90 | this.videoCategories = this.videoService.videoCategories; |
86 | this.videoLicences = this.videoService.videoLicences; | 91 | this.videoLicences = this.videoService.videoLicences; |
92 | this.videoLanguages = this.videoService.videoLanguages; | ||
87 | 93 | ||
88 | this.uploader = new FileUploader({ | 94 | this.uploader = new FileUploader({ |
89 | authToken: this.authService.getRequestHeaderValue(), | 95 | authToken: this.authService.getRequestHeaderValue(), |
@@ -97,12 +103,19 @@ export class VideoAddComponent extends FormReactive implements OnInit { | |||
97 | const nsfw = this.form.value['nsfw']; | 103 | const nsfw = this.form.value['nsfw']; |
98 | const category = this.form.value['category']; | 104 | const category = this.form.value['category']; |
99 | const licence = this.form.value['licence']; | 105 | const licence = this.form.value['licence']; |
106 | const language = this.form.value['language']; | ||
100 | const description = this.form.value['description']; | 107 | const description = this.form.value['description']; |
101 | 108 | ||
102 | form.append('name', name); | 109 | form.append('name', name); |
103 | form.append('category', category); | 110 | form.append('category', category); |
104 | form.append('nsfw', nsfw); | 111 | form.append('nsfw', nsfw); |
105 | form.append('licence', licence); | 112 | form.append('licence', licence); |
113 | |||
114 | // Language is optional | ||
115 | if (language) { | ||
116 | form.append('language', language); | ||
117 | } | ||
118 | |||
106 | form.append('description', description); | 119 | form.append('description', description); |
107 | 120 | ||
108 | for (let i = 0; i < this.tags.length; i++) { | 121 | for (let i = 0; i < this.tags.length; i++) { |