From 2c8776fc316da9719e5ebc55dfabdcac9e197ac4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 4 Feb 2020 16:14:33 +0100 Subject: Optimize view endpoint --- server/controllers/api/videos/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/controllers/api/videos/index.ts') diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 1d61f8427..eb46ea01f 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts @@ -135,7 +135,7 @@ videosRouter.get('/:id', asyncMiddleware(getVideo) ) videosRouter.post('/:id/views', - asyncMiddleware(videosGetValidator), + asyncMiddleware(videosCustomGetValidator('only-immutable-attributes')), asyncMiddleware(viewVideo) ) @@ -458,7 +458,7 @@ async function getVideo (req: express.Request, res: express.Response) { } async function viewVideo (req: express.Request, res: express.Response) { - const videoInstance = res.locals.videoAll + const videoInstance = res.locals.onlyImmutableVideo const ip = req.ip const exists = await Redis.Instance.doesVideoIPViewExist(ip, videoInstance.uuid) -- cgit v1.2.3