diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-11 14:09:33 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-11 14:09:52 +0200 |
commit | 71d4af1efc810f853e1a0d986bf758c201692594 (patch) | |
tree | 2066053638baefb6430772c2e0a0aa1774019a51 /server/controllers | |
parent | 3c79c2ce86eaf9e151ab6c2c9d1f646968a16744 (diff) | |
download | PeerTube-71d4af1efc810f853e1a0d986bf758c201692594.tar.gz PeerTube-71d4af1efc810f853e1a0d986bf758c201692594.tar.zst PeerTube-71d4af1efc810f853e1a0d986bf758c201692594.zip |
Use raw SQL for most of video queries
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/activitypub/client.ts | 7 |
1 files changed, 3 insertions, 4 deletions
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', | |||
78 | activityPubClientRouter.get('/videos/watch/:id', | 78 | activityPubClientRouter.get('/videos/watch/:id', |
79 | executeIfActivityPub, | 79 | executeIfActivityPub, |
80 | asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.ACTIVITY_PUB.VIDEOS)), | 80 | asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.ACTIVITY_PUB.VIDEOS)), |
81 | asyncMiddleware(videosCustomGetValidator('only-video-with-rights')), | 81 | asyncMiddleware(videosCustomGetValidator('all')), |
82 | asyncMiddleware(videoController) | 82 | asyncMiddleware(videoController) |
83 | ) | 83 | ) |
84 | activityPubClientRouter.get('/videos/watch/:id/activity', | 84 | activityPubClientRouter.get('/videos/watch/:id/activity', |
85 | executeIfActivityPub, | 85 | executeIfActivityPub, |
86 | asyncMiddleware(videosCustomGetValidator('only-video-with-rights')), | 86 | asyncMiddleware(videosCustomGetValidator('all')), |
87 | asyncMiddleware(videoController) | 87 | asyncMiddleware(videoController) |
88 | ) | 88 | ) |
89 | activityPubClientRouter.get('/videos/watch/:id/announces', | 89 | activityPubClientRouter.get('/videos/watch/:id/announces', |
@@ -222,8 +222,7 @@ function getAccountVideoRateFactory (rateType: VideoRateType) { | |||
222 | } | 222 | } |
223 | 223 | ||
224 | async function videoController (req: express.Request, res: express.Response) { | 224 | async function videoController (req: express.Request, res: express.Response) { |
225 | // We need more attributes | 225 | const video = res.locals.videoAll |
226 | const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(res.locals.onlyVideoWithRights.id) | ||
227 | 226 | ||
228 | if (redirectIfNotOwned(video.url, res)) return | 227 | if (redirectIfNotOwned(video.url, res)) return |
229 | 228 | ||