diff options
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r-- | server/middlewares/validators/shared/videos.ts | 5 | ||||
-rw-r--r-- | server/middlewares/validators/videos/videos.ts | 2 |
2 files changed, 6 insertions, 1 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 |
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index 7f278c9f6..a707fd086 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts | |||
@@ -258,7 +258,7 @@ async function checkVideoFollowConstraints (req: express.Request, res: express.R | |||
258 | } | 258 | } |
259 | 259 | ||
260 | const videosCustomGetValidator = ( | 260 | const videosCustomGetValidator = ( |
261 | fetchType: 'all' | 'only-video' | 'only-video-with-rights' | 'only-immutable-attributes', | 261 | fetchType: 'for-api' | 'all' | 'only-video' | 'only-video-with-rights' | 'only-immutable-attributes', |
262 | authenticateInQuery = false | 262 | authenticateInQuery = false |
263 | ) => { | 263 | ) => { |
264 | return [ | 264 | return [ |