aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/videos.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-22 15:42:55 +0200
committerChocobozzz <me@florianbigard.com>2018-06-22 15:42:55 +0200
commit0c237b19fdf9c614293c1442f0ab95a81ce05735 (patch)
tree81f7ae4262630da5e8041bd70e2cb856e48253a3 /server/helpers/custom-validators/videos.ts
parentc4082b8b4e3684baae0172e97297c936d7419f2c (diff)
downloadPeerTube-0c237b19fdf9c614293c1442f0ab95a81ce05735.tar.gz
PeerTube-0c237b19fdf9c614293c1442f0ab95a81ce05735.tar.zst
PeerTube-0c237b19fdf9c614293c1442f0ab95a81ce05735.zip
Fix images size limit
Diffstat (limited to 'server/helpers/custom-validators/videos.ts')
-rw-r--r--server/helpers/custom-validators/videos.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts
index a227136ac..ae392f8c2 100644
--- a/server/helpers/custom-validators/videos.ts
+++ b/server/helpers/custom-validators/videos.ts
@@ -86,7 +86,7 @@ const videoFileTypes = Object.keys(VIDEO_MIMETYPE_EXT).map(m => `(${m})`)
86const videoFileTypesRegex = videoFileTypes.join('|') 86const videoFileTypesRegex = videoFileTypes.join('|')
87 87
88function isVideoFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) { 88function isVideoFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) {
89 return isFileValid(files, videoFileTypesRegex, 'videofile') 89 return isFileValid(files, videoFileTypesRegex, 'videofile', null)
90} 90}
91 91
92const videoImageTypes = CONSTRAINTS_FIELDS.VIDEOS.IMAGE.EXTNAME 92const videoImageTypes = CONSTRAINTS_FIELDS.VIDEOS.IMAGE.EXTNAME
@@ -95,7 +95,7 @@ const videoImageTypes = CONSTRAINTS_FIELDS.VIDEOS.IMAGE.EXTNAME
95const videoImageTypesRegex = `image/(${videoImageTypes})` 95const videoImageTypesRegex = `image/(${videoImageTypes})`
96 96
97function isVideoImage (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[], field: string) { 97function isVideoImage (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[], field: string) {
98 return isFileValid(files, videoImageTypesRegex, field, true) 98 return isFileValid(files, videoImageTypesRegex, field, CONSTRAINTS_FIELDS.VIDEOS.IMAGE.FILE_SIZE.max, true)
99} 99}
100 100
101function isVideoPrivacyValid (value: number) { 101function isVideoPrivacyValid (value: number) {