aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/activitypub/client.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-11 14:09:33 +0200
committerChocobozzz <me@florianbigard.com>2021-06-11 14:09:52 +0200
commit71d4af1efc810f853e1a0d986bf758c201692594 (patch)
tree2066053638baefb6430772c2e0a0aa1774019a51 /server/controllers/activitypub/client.ts
parent3c79c2ce86eaf9e151ab6c2c9d1f646968a16744 (diff)
downloadPeerTube-71d4af1efc810f853e1a0d986bf758c201692594.tar.gz
PeerTube-71d4af1efc810f853e1a0d986bf758c201692594.tar.zst
PeerTube-71d4af1efc810f853e1a0d986bf758c201692594.zip
Use raw SQL for most of video queries
Diffstat (limited to 'server/controllers/activitypub/client.ts')
-rw-r--r--server/controllers/activitypub/client.ts7
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',
78activityPubClientRouter.get('/videos/watch/:id', 78activityPubClientRouter.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)
84activityPubClientRouter.get('/videos/watch/:id/activity', 84activityPubClientRouter.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)
89activityPubClientRouter.get('/videos/watch/:id/announces', 89activityPubClientRouter.get('/videos/watch/:id/announces',
@@ -222,8 +222,7 @@ function getAccountVideoRateFactory (rateType: VideoRateType) {
222} 222}
223 223
224async function videoController (req: express.Request, res: express.Response) { 224async 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