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.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts
index 35f0b3152..8d4ff07eb 100644
--- a/server/controllers/api/videos/index.ts
+++ b/server/controllers/api/videos/index.ts
@@ -48,7 +48,7 @@ import { videoCommentRouter } from './comment'
48import { rateVideoRouter } from './rate' 48import { rateVideoRouter } from './rate'
49import { ownershipVideoRouter } from './ownership' 49import { ownershipVideoRouter } from './ownership'
50import { VideoFilter } from '../../../../shared/models/videos/video-query.type' 50import { VideoFilter } from '../../../../shared/models/videos/video-query.type'
51import { buildNSFWFilter, createReqFiles } from '../../../helpers/express-utils' 51import { buildNSFWFilter, createReqFiles, getCountVideos } from '../../../helpers/express-utils'
52import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update' 52import { ScheduleVideoUpdateModel } from '../../../models/video/schedule-video-update'
53import { videoCaptionsRouter } from './captions' 53import { videoCaptionsRouter } from './captions'
54import { videoImportsRouter } from './import' 54import { videoImportsRouter } from './import'
@@ -495,6 +495,8 @@ async function getVideoDescription (req: express.Request, res: express.Response)
495} 495}
496 496
497async function listVideos (req: express.Request, res: express.Response) { 497async function listVideos (req: express.Request, res: express.Response) {
498 const countVideos = getCountVideos(req)
499
498 const apiOptions = await Hooks.wrapObject({ 500 const apiOptions = await Hooks.wrapObject({
499 start: req.query.start, 501 start: req.query.start,
500 count: req.query.count, 502 count: req.query.count,
@@ -508,7 +510,8 @@ async function listVideos (req: express.Request, res: express.Response) {
508 nsfw: buildNSFWFilter(res, req.query.nsfw), 510 nsfw: buildNSFWFilter(res, req.query.nsfw),
509 filter: req.query.filter as VideoFilter, 511 filter: req.query.filter as VideoFilter,
510 withFiles: false, 512 withFiles: false,
511 user: res.locals.oauth ? res.locals.oauth.token.User : undefined 513 user: res.locals.oauth ? res.locals.oauth.token.User : undefined,
514 countVideos
512 }, 'filter:api.videos.list.params') 515 }, 'filter:api.videos.list.params')
513 516
514 const resultList = await Hooks.wrapPromiseFun( 517 const resultList = await Hooks.wrapPromiseFun(