aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos/videos.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-20 13:52:49 +0200
committerChocobozzz <me@florianbigard.com>2019-08-20 14:53:42 +0200
commit0283eaac2a8e73006c66df3cf5bb9012e37450e5 (patch)
tree1fb73aeef57f984a77f47828ade23c6365ce8eb0 /server/middlewares/validators/videos/videos.ts
parent96ca24f00e5ae5471dee9ee596489fe50af2b46f (diff)
downloadPeerTube-0283eaac2a8e73006c66df3cf5bb9012e37450e5.tar.gz
PeerTube-0283eaac2a8e73006c66df3cf5bb9012e37450e5.tar.zst
PeerTube-0283eaac2a8e73006c66df3cf5bb9012e37450e5.zip
Cleanup model types
Diffstat (limited to 'server/middlewares/validators/videos/videos.ts')
-rw-r--r--server/middlewares/validators/videos/videos.ts6
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'
44import { Hooks } from '../../../lib/plugins/hooks' 44import { Hooks } from '../../../lib/plugins/hooks'
45import { checkUserCanManageVideo, doesVideoChannelOfAccountExist, doesVideoExist } from '../../../helpers/middlewares' 45import { checkUserCanManageVideo, doesVideoChannelOfAccountExist, doesVideoExist } from '../../../helpers/middlewares'
46import { MVideoFullLight } from '@server/typings/models' 46import { MVideoFullLight } from '@server/typings/models'
47import { getVideo } from '../../../helpers/video' 47import { getVideoWithAttributes } from '../../../helpers/video'
48 48
49const videosAddValidator = getCommonVideoEditAttributes().concat([ 49const videosAddValidator = getCommonVideoEditAttributes().concat([
50 body('videofile') 50 body('videofile')
@@ -123,7 +123,7 @@ const videosUpdateValidator = getCommonVideoEditAttributes().concat([
123]) 123])
124 124
125async function checkVideoFollowConstraints (req: express.Request, res: express.Response, next: express.NextFunction) { 125async 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