aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-11 09:57:19 +0200
committerChocobozzz <me@florianbigard.com>2021-06-11 09:57:19 +0200
commitca4b4b2e5590c1b37cff1fe1be7f797b93351229 (patch)
treee454de8be7b0dd6c28b08f27234fe6992ab9929c /server/middlewares/validators/shared
parent1d43c3a613c72d69f7360fee9e5bfe6f662d62f7 (diff)
downloadPeerTube-ca4b4b2e5590c1b37cff1fe1be7f797b93351229.tar.gz
PeerTube-ca4b4b2e5590c1b37cff1fe1be7f797b93351229.tar.zst
PeerTube-ca4b4b2e5590c1b37cff1fe1be7f797b93351229.zip
Fetch directly all video attributes for get API
Diffstat (limited to 'server/middlewares/validators/shared')
-rw-r--r--server/middlewares/validators/shared/videos.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/middlewares/validators/shared/videos.ts b/server/middlewares/validators/shared/videos.ts
index 3134f623d..1a22d6513 100644
--- a/server/middlewares/validators/shared/videos.ts
+++ b/server/middlewares/validators/shared/videos.ts
@@ -6,6 +6,7 @@ import {
6 MUser, 6 MUser,
7 MUserAccountId, 7 MUserAccountId,
8 MVideoAccountLight, 8 MVideoAccountLight,
9 MVideoFormattableDetails,
9 MVideoFullLight, 10 MVideoFullLight,
10 MVideoIdThumbnail, 11 MVideoIdThumbnail,
11 MVideoImmutable, 12 MVideoImmutable,
@@ -29,6 +30,10 @@ async function doesVideoExist (id: number | string, res: Response, fetchType: Vi
29 } 30 }
30 31
31 switch (fetchType) { 32 switch (fetchType) {
33 case 'for-api':
34 res.locals.videoAPI = video as MVideoFormattableDetails
35 break
36
32 case 'all': 37 case 'all':
33 res.locals.videoAll = video as MVideoFullLight 38 res.locals.videoAll = video as MVideoFullLight
34 break 39 break