diff options
author | Chocobozzz <me@florianbigard.com> | 2020-02-04 15:00:47 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-02-04 15:00:47 +0100 |
commit | 7eba5e1fa81c8e54cb8fe298a96e8070afa50921 (patch) | |
tree | a6bd4b13dc0d65addfa82fcf200f2d1853a0723a /server/middlewares/validators/videos | |
parent | e436baf0b00b3ecf3731aeba02437ebe4906ac5f (diff) | |
download | PeerTube-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.ts | 5 |
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 | ||
150 | const videosCustomGetValidator = (fetchType: 'all' | 'only-video' | 'only-video-with-rights', authenticateInQuery = false) => { | 150 | const 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 | ||