From 71d4af1efc810f853e1a0d986bf758c201692594 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 11 Jun 2021 14:09:33 +0200 Subject: Use raw SQL for most of video queries --- server/controllers/activitypub/client.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'server/controllers/activitypub') diff --git a/server/controllers/activitypub/client.ts b/server/controllers/activitypub/client.ts index 1982e171d..444a8abaa 100644 --- a/server/controllers/activitypub/client.ts +++ b/server/controllers/activitypub/client.ts @@ -78,12 +78,12 @@ activityPubClientRouter.get('/accounts?/:name/dislikes/:videoId', activityPubClientRouter.get('/videos/watch/:id', executeIfActivityPub, asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.ACTIVITY_PUB.VIDEOS)), - asyncMiddleware(videosCustomGetValidator('only-video-with-rights')), + asyncMiddleware(videosCustomGetValidator('all')), asyncMiddleware(videoController) ) activityPubClientRouter.get('/videos/watch/:id/activity', executeIfActivityPub, - asyncMiddleware(videosCustomGetValidator('only-video-with-rights')), + asyncMiddleware(videosCustomGetValidator('all')), asyncMiddleware(videoController) ) activityPubClientRouter.get('/videos/watch/:id/announces', @@ -222,8 +222,7 @@ function getAccountVideoRateFactory (rateType: VideoRateType) { } async function videoController (req: express.Request, res: express.Response) { - // We need more attributes - const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(res.locals.onlyVideoWithRights.id) + const video = res.locals.videoAll if (redirectIfNotOwned(video.url, res)) return -- cgit v1.2.3