aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/videos/index.ts')
-rw-r--r--server/controllers/api/videos/index.ts17
1 files changed, 8 insertions, 9 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts
index 61b6c5826..4b3198a74 100644
--- a/server/controllers/api/videos/index.ts
+++ b/server/controllers/api/videos/index.ts
@@ -42,7 +42,6 @@ import { VideoModel } from '../../../models/video/video'
42import { VideoFileModel } from '../../../models/video/video-file' 42import { VideoFileModel } from '../../../models/video/video-file'
43import { abuseVideoRouter } from './abuse' 43import { abuseVideoRouter } from './abuse'
44import { blacklistRouter } from './blacklist' 44import { blacklistRouter } from './blacklist'
45import { videoChannelRouter } from './channel'
46import { videoCommentRouter } from './comment' 45import { videoCommentRouter } from './comment'
47import { rateVideoRouter } from './rate' 46import { rateVideoRouter } from './rate'
48import { VideoFilter } from '../../../../shared/models/videos/video-query.type' 47import { VideoFilter } from '../../../../shared/models/videos/video-query.type'
@@ -72,7 +71,6 @@ const reqVideoFileUpdate = createReqFiles(
72videosRouter.use('/', abuseVideoRouter) 71videosRouter.use('/', abuseVideoRouter)
73videosRouter.use('/', blacklistRouter) 72videosRouter.use('/', blacklistRouter)
74videosRouter.use('/', rateVideoRouter) 73videosRouter.use('/', rateVideoRouter)
75videosRouter.use('/', videoChannelRouter)
76videosRouter.use('/', videoCommentRouter) 74videosRouter.use('/', videoCommentRouter)
77 75
78videosRouter.get('/categories', listVideoCategories) 76videosRouter.get('/categories', listVideoCategories)
@@ -397,13 +395,14 @@ async function getVideoDescription (req: express.Request, res: express.Response)
397} 395}
398 396
399async function listVideos (req: express.Request, res: express.Response, next: express.NextFunction) { 397async function listVideos (req: express.Request, res: express.Response, next: express.NextFunction) {
400 const resultList = await VideoModel.listForApi( 398 const resultList = await VideoModel.listForApi({
401 req.query.start as number, 399 start: req.query.start,
402 req.query.count as number, 400 count: req.query.count,
403 req.query.sort as VideoSortField, 401 sort: req.query.sort,
404 isNSFWHidden(res), 402 hideNSFW: isNSFWHidden(res),
405 req.query.filter as VideoFilter 403 filter: req.query.filter as VideoFilter,
406 ) 404 withFiles: false
405 })
407 406
408 return res.json(getFormattedObjects(resultList.data, resultList.total)) 407 return res.json(getFormattedObjects(resultList.data, resultList.total))
409} 408}