From 943e5193905908dd1f2800d8810c635d86e3b28f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 4 Feb 2020 15:45:41 +0100 Subject: Don't refresh videos when processing views It allows us to use a cache --- server/middlewares/validators/videos/videos.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'server/middlewares') diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index c14184b35..a027c4840 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts @@ -160,6 +160,9 @@ const videosCustomGetValidator = ( if (areValidationErrors(req, res)) return if (!await doesVideoExist(req.params.id, res, fetchType)) return + // Controllers does not need to check video rights + if (fetchType === 'only-immutable-attributes') return next() + const video = getVideoWithAttributes(res) const videoAll = video as MVideoFullLight -- cgit v1.2.3