diff options
author | Chocobozzz <me@florianbigard.com> | 2020-09-17 09:20:52 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-09 15:33:04 +0100 |
commit | c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e (patch) | |
tree | 79304b0152b0a38d33b26e65d4acdad0da4032a7 /server/helpers/custom-validators | |
parent | 110d463fece85e87a26aca48a6048ae0017a27b3 (diff) | |
download | PeerTube-c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e.tar.gz PeerTube-c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e.tar.zst PeerTube-c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e.zip |
Live streaming implementation first step
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r-- | server/helpers/custom-validators/videos.ts | 5 |
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' |
13 | import { exists, isArray, isDateValid, isFileValid } from './misc' | 14 | import { exists, isArray, isDateValid, isFileValid } from './misc' |
14 | import * as magnetUtil from 'magnet-uri' | 15 | import * as magnetUtil from 'magnet-uri' |
@@ -77,7 +78,7 @@ function isVideoRatingTypeValid (value: string) { | |||
77 | } | 78 | } |
78 | 79 | ||
79 | function isVideoFileExtnameValid (value: string) { | 80 | function 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 | ||
83 | function isVideoFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) { | 84 | function isVideoFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) { |