diff options
author | Chocobozzz <me@florianbigard.com> | 2020-02-04 15:45:41 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-02-04 15:58:59 +0100 |
commit | 943e5193905908dd1f2800d8810c635d86e3b28f (patch) | |
tree | 961973733e6e4afb58ac222d2847a3fc4b6d6d60 /server/middlewares/validators/videos | |
parent | 7eba5e1fa81c8e54cb8fe298a96e8070afa50921 (diff) | |
download | PeerTube-943e5193905908dd1f2800d8810c635d86e3b28f.tar.gz PeerTube-943e5193905908dd1f2800d8810c635d86e3b28f.tar.zst PeerTube-943e5193905908dd1f2800d8810c635d86e3b28f.zip |
Don't refresh videos when processing views
It allows us to use a cache
Diffstat (limited to 'server/middlewares/validators/videos')
-rw-r--r-- | server/middlewares/validators/videos/videos.ts | 3 |
1 files changed, 3 insertions, 0 deletions
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 = ( | |||
160 | if (areValidationErrors(req, res)) return | 160 | if (areValidationErrors(req, res)) return |
161 | if (!await doesVideoExist(req.params.id, res, fetchType)) return | 161 | if (!await doesVideoExist(req.params.id, res, fetchType)) return |
162 | 162 | ||
163 | // Controllers does not need to check video rights | ||
164 | if (fetchType === 'only-immutable-attributes') return next() | ||
165 | |||
163 | const video = getVideoWithAttributes(res) | 166 | const video = getVideoWithAttributes(res) |
164 | const videoAll = video as MVideoFullLight | 167 | const videoAll = video as MVideoFullLight |
165 | 168 | ||