aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r--server/helpers/custom-validators/videos.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts
index 40fecc09b..e99992236 100644
--- a/server/helpers/custom-validators/videos.ts
+++ b/server/helpers/custom-validators/videos.ts
@@ -8,7 +8,8 @@ import {
8 VIDEO_LICENCES, 8 VIDEO_LICENCES,
9 VIDEO_PRIVACIES, 9 VIDEO_PRIVACIES,
10 VIDEO_RATE_TYPES, 10 VIDEO_RATE_TYPES,
11 VIDEO_STATES 11 VIDEO_STATES,
12 VIDEO_LIVE
12} from '../../initializers/constants' 13} from '../../initializers/constants'
13import { exists, isArray, isDateValid, isFileValid } from './misc' 14import { exists, isArray, isDateValid, isFileValid } from './misc'
14import * as magnetUtil from 'magnet-uri' 15import * as magnetUtil from 'magnet-uri'
@@ -77,7 +78,7 @@ function isVideoRatingTypeValid (value: string) {
77} 78}
78 79
79function isVideoFileExtnameValid (value: string) { 80function isVideoFileExtnameValid (value: string) {
80 return exists(value) && MIMETYPES.VIDEO.EXT_MIMETYPE[value] !== undefined 81 return exists(value) && (value === VIDEO_LIVE.EXTENSION || MIMETYPES.VIDEO.EXT_MIMETYPE[value] !== undefined)
81} 82}
82 83
83function isVideoFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) { 84function isVideoFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) {