diff options
author | Chocobozzz <me@florianbigard.com> | 2020-04-07 10:40:52 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-04-07 10:40:52 +0200 |
commit | edaf5b862ab6845d0cc528703cc45c9a9acd4693 (patch) | |
tree | 2c3a526a2872e4e32114eb04b7933bc95b0d3eb8 /server/helpers/custom-validators/video-captions.ts | |
parent | be6343d26ec07fd792de069229bd3be27e72d129 (diff) | |
download | PeerTube-edaf5b862ab6845d0cc528703cc45c9a9acd4693.tar.gz PeerTube-edaf5b862ab6845d0cc528703cc45c9a9acd4693.tar.zst PeerTube-edaf5b862ab6845d0cc528703cc45c9a9acd4693.zip |
Fix torrent import on windows
Diffstat (limited to 'server/helpers/custom-validators/video-captions.ts')
-rw-r--r-- | server/helpers/custom-validators/video-captions.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/helpers/custom-validators/video-captions.ts b/server/helpers/custom-validators/video-captions.ts index 9abbce04a..528edf60c 100644 --- a/server/helpers/custom-validators/video-captions.ts +++ b/server/helpers/custom-validators/video-captions.ts | |||
@@ -5,10 +5,10 @@ function isVideoCaptionLanguageValid (value: any) { | |||
5 | return exists(value) && VIDEO_LANGUAGES[value] !== undefined | 5 | return exists(value) && VIDEO_LANGUAGES[value] !== undefined |
6 | } | 6 | } |
7 | 7 | ||
8 | const videoCaptionTypes = Object.keys(MIMETYPES.VIDEO_CAPTIONS.MIMETYPE_EXT) | 8 | const videoCaptionTypesRegex = Object.keys(MIMETYPES.VIDEO_CAPTIONS.MIMETYPE_EXT) |
9 | .concat([ 'application/octet-stream' ]) // MacOS sends application/octet-stream >< | 9 | .concat([ 'application/octet-stream' ]) // MacOS sends application/octet-stream |
10 | .map(m => `(${m})`) | 10 | .map(m => `(${m})`) |
11 | const videoCaptionTypesRegex = videoCaptionTypes.join('|') | 11 | .join('|') |
12 | function isVideoCaptionFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[], field: string) { | 12 | function isVideoCaptionFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[], field: string) { |
13 | return isFileValid(files, videoCaptionTypesRegex, field, CONSTRAINTS_FIELDS.VIDEO_CAPTIONS.CAPTION_FILE.FILE_SIZE.max) | 13 | return isFileValid(files, videoCaptionTypesRegex, field, CONSTRAINTS_FIELDS.VIDEO_CAPTIONS.CAPTION_FILE.FILE_SIZE.max) |
14 | } | 14 | } |