aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-02-04 15:00:47 +0100
committerChocobozzz <me@florianbigard.com>2020-02-04 15:00:47 +0100
commit7eba5e1fa81c8e54cb8fe298a96e8070afa50921 (patch)
treea6bd4b13dc0d65addfa82fcf200f2d1853a0723a /server/middlewares/validators/videos
parente436baf0b00b3ecf3731aeba02437ebe4906ac5f (diff)
downloadPeerTube-7eba5e1fa81c8e54cb8fe298a96e8070afa50921.tar.gz
PeerTube-7eba5e1fa81c8e54cb8fe298a96e8070afa50921.tar.zst
PeerTube-7eba5e1fa81c8e54cb8fe298a96e8070afa50921.zip
Add model cache for video
When fetching only immutable attributes
Diffstat (limited to 'server/middlewares/validators/videos')
-rw-r--r--server/middlewares/validators/videos/videos.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts
index 11dd02706..c14184b35 100644
--- a/server/middlewares/validators/videos/videos.ts
+++ b/server/middlewares/validators/videos/videos.ts
@@ -147,7 +147,10 @@ async function checkVideoFollowConstraints (req: express.Request, res: express.R
147 }) 147 })
148} 148}
149 149
150const videosCustomGetValidator = (fetchType: 'all' | 'only-video' | 'only-video-with-rights', authenticateInQuery = false) => { 150const videosCustomGetValidator = (
151 fetchType: 'all' | 'only-video' | 'only-video-with-rights' | 'only-immutable-attributes',
152 authenticateInQuery = false
153) => {
151 return [ 154 return [
152 param('id').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'), 155 param('id').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'),
153 156