mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Optimize view endpoint
This commit is contained in:
parent
943e519390
commit
2c8776fc31
6 changed files with 46 additions and 21 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue