diff options
Diffstat (limited to 'server/middlewares/validators/videos/videos.ts')
-rw-r--r-- | server/middlewares/validators/videos/videos.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index a194d14b3..1449903b7 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts | |||
@@ -44,7 +44,7 @@ import { isLocalVideoAccepted } from '../../../lib/moderation' | |||
44 | import { Hooks } from '../../../lib/plugins/hooks' | 44 | import { Hooks } from '../../../lib/plugins/hooks' |
45 | import { checkUserCanManageVideo, doesVideoChannelOfAccountExist, doesVideoExist } from '../../../helpers/middlewares' | 45 | import { checkUserCanManageVideo, doesVideoChannelOfAccountExist, doesVideoExist } from '../../../helpers/middlewares' |
46 | import { MVideoFullLight } from '@server/typings/models' | 46 | import { MVideoFullLight } from '@server/typings/models' |
47 | import { getVideo } from '../../../helpers/video' | 47 | import { getVideoWithAttributes } from '../../../helpers/video' |
48 | 48 | ||
49 | const videosAddValidator = getCommonVideoEditAttributes().concat([ | 49 | const videosAddValidator = getCommonVideoEditAttributes().concat([ |
50 | body('videofile') | 50 | body('videofile') |
@@ -123,7 +123,7 @@ const videosUpdateValidator = getCommonVideoEditAttributes().concat([ | |||
123 | ]) | 123 | ]) |
124 | 124 | ||
125 | async function checkVideoFollowConstraints (req: express.Request, res: express.Response, next: express.NextFunction) { | 125 | async function checkVideoFollowConstraints (req: express.Request, res: express.Response, next: express.NextFunction) { |
126 | const video = getVideo(res) | 126 | const video = getVideoWithAttributes(res) |
127 | 127 | ||
128 | // Anybody can watch local videos | 128 | // Anybody can watch local videos |
129 | if (video.isOwned() === true) return next() | 129 | if (video.isOwned() === true) return next() |
@@ -157,7 +157,7 @@ const videosCustomGetValidator = (fetchType: 'all' | 'only-video' | 'only-video- | |||
157 | if (areValidationErrors(req, res)) return | 157 | if (areValidationErrors(req, res)) return |
158 | if (!await doesVideoExist(req.params.id, res, fetchType)) return | 158 | if (!await doesVideoExist(req.params.id, res, fetchType)) return |
159 | 159 | ||
160 | const video = getVideo(res) | 160 | const video = getVideoWithAttributes(res) |
161 | const videoAll = video as MVideoFullLight | 161 | const videoAll = video as MVideoFullLight |
162 | 162 | ||
163 | // Video private or blacklisted | 163 | // Video private or blacklisted |