aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos/video-watch.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-28 17:30:59 +0200
committerChocobozzz <chocobozzz@cpy.re>2021-06-29 14:56:35 +0200
commitd4a8e7a65f97bb3257facc13e1ae8ffdbad61ddb (patch)
treea4cb07318100031951c3dffc61f4f2cb95d2cbd0 /server/middlewares/validators/videos/video-watch.ts
parent62ddc31a9e4b92d7d27898ccfc363f68ab044139 (diff)
downloadPeerTube-d4a8e7a65f97bb3257facc13e1ae8ffdbad61ddb.tar.gz
PeerTube-d4a8e7a65f97bb3257facc13e1ae8ffdbad61ddb.tar.zst
PeerTube-d4a8e7a65f97bb3257facc13e1ae8ffdbad61ddb.zip
Support short uuid for GET video/playlist
Diffstat (limited to 'server/middlewares/validators/videos/video-watch.ts')
-rw-r--r--server/middlewares/validators/videos/video-watch.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/middlewares/validators/videos/video-watch.ts b/server/middlewares/validators/videos/video-watch.ts
index ef8b89ece..43306f7cd 100644
--- a/server/middlewares/validators/videos/video-watch.ts
+++ b/server/middlewares/validators/videos/video-watch.ts
@@ -1,12 +1,13 @@
1import * as express from 'express' 1import * as express from 'express'
2import { body, param } from 'express-validator' 2import { body } from 'express-validator'
3import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' 3import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
4import { isIdOrUUIDValid, toIntOrNull } from '../../../helpers/custom-validators/misc' 4import { toIntOrNull } from '../../../helpers/custom-validators/misc'
5import { logger } from '../../../helpers/logger' 5import { logger } from '../../../helpers/logger'
6import { areValidationErrors, doesVideoExist } from '../shared' 6import { areValidationErrors, doesVideoExist, isValidVideoIdParam } from '../shared'
7 7
8const videoWatchingValidator = [ 8const videoWatchingValidator = [
9 param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'), 9 isValidVideoIdParam('videoId'),
10
10 body('currentTime') 11 body('currentTime')
11 .customSanitizer(toIntOrNull) 12 .customSanitizer(toIntOrNull)
12 .isInt().withMessage('Should have correct current time'), 13 .isInt().withMessage('Should have correct current time'),