aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos/videos.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-26 10:55:40 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-03-18 11:17:59 +0100
commit418d092afa81e2c8fe8ac6838fc4b5eb0af6a782 (patch)
tree5e9bc5604fd5d66a006cfebb7acdbdd5486e5d1e /server/middlewares/validators/videos/videos.ts
parentb427febb4d5cebf03b815bca2c59af6e82491569 (diff)
downloadPeerTube-418d092afa81e2c8fe8ac6838fc4b5eb0af6a782.tar.gz
PeerTube-418d092afa81e2c8fe8ac6838fc4b5eb0af6a782.tar.zst
PeerTube-418d092afa81e2c8fe8ac6838fc4b5eb0af6a782.zip
Playlist server API
Diffstat (limited to 'server/middlewares/validators/videos/videos.ts')
-rw-r--r--server/middlewares/validators/videos/videos.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts
index 159727e28..a5e3ed0dc 100644
--- a/server/middlewares/validators/videos/videos.ts
+++ b/server/middlewares/validators/videos/videos.ts
@@ -46,7 +46,7 @@ import { VideoFetchType } from '../../../helpers/video'
46import { isNSFWQueryValid, isNumberArray, isStringArray } from '../../../helpers/custom-validators/search' 46import { isNSFWQueryValid, isNumberArray, isStringArray } from '../../../helpers/custom-validators/search'
47import { getServerActor } from '../../../helpers/utils' 47import { getServerActor } from '../../../helpers/utils'
48 48
49const videosAddValidator = getCommonVideoAttributes().concat([ 49const videosAddValidator = getCommonVideoEditAttributes().concat([
50 body('videofile') 50 body('videofile')
51 .custom((value, { req }) => isVideoFile(req.files)).withMessage( 51 .custom((value, { req }) => isVideoFile(req.files)).withMessage(
52 'This file is not supported or too large. Please, make sure it is of the following type: ' 52 'This file is not supported or too large. Please, make sure it is of the following type: '
@@ -94,7 +94,7 @@ const videosAddValidator = getCommonVideoAttributes().concat([
94 } 94 }
95]) 95])
96 96
97const videosUpdateValidator = getCommonVideoAttributes().concat([ 97const videosUpdateValidator = getCommonVideoEditAttributes().concat([
98 param('id').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'), 98 param('id').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'),
99 body('name') 99 body('name')
100 .optional() 100 .optional()
@@ -288,7 +288,7 @@ const videosAcceptChangeOwnershipValidator = [
288 } 288 }
289] 289]
290 290
291function getCommonVideoAttributes () { 291function getCommonVideoEditAttributes () {
292 return [ 292 return [
293 body('thumbnailfile') 293 body('thumbnailfile')
294 .custom((value, { req }) => isVideoImage(req.files, 'thumbnailfile')).withMessage( 294 .custom((value, { req }) => isVideoImage(req.files, 'thumbnailfile')).withMessage(
@@ -421,7 +421,7 @@ export {
421 videosTerminateChangeOwnershipValidator, 421 videosTerminateChangeOwnershipValidator,
422 videosAcceptChangeOwnershipValidator, 422 videosAcceptChangeOwnershipValidator,
423 423
424 getCommonVideoAttributes, 424 getCommonVideoEditAttributes,
425 425
426 commonVideosFiltersValidator 426 commonVideosFiltersValidator
427} 427}