aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/video-channel.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/video-channel.ts')
-rw-r--r--server/controllers/api/video-channel.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts
index acc5b2987..e1f37a8fb 100644
--- a/server/controllers/api/video-channel.ts
+++ b/server/controllers/api/video-channel.ts
@@ -20,7 +20,7 @@ import { videoChannelsNameWithHostValidator, videosSortValidator } from '../../m
20import { sendUpdateActor } from '../../lib/activitypub/send' 20import { sendUpdateActor } from '../../lib/activitypub/send'
21import { VideoChannelCreate, VideoChannelUpdate } from '../../../shared' 21import { VideoChannelCreate, VideoChannelUpdate } from '../../../shared'
22import { createLocalVideoChannel, federateAllVideosOfChannel } from '../../lib/video-channel' 22import { createLocalVideoChannel, federateAllVideosOfChannel } from '../../lib/video-channel'
23import { buildNSFWFilter, createReqFiles, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils' 23import { buildNSFWFilter, createReqFiles, getCountVideos, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils'
24import { setAsyncActorKeys } from '../../lib/activitypub' 24import { setAsyncActorKeys } from '../../lib/activitypub'
25import { AccountModel } from '../../models/account/account' 25import { AccountModel } from '../../models/account/account'
26import { MIMETYPES } from '../../initializers/constants' 26import { MIMETYPES } from '../../initializers/constants'
@@ -256,6 +256,7 @@ async function listVideoChannelPlaylists (req: express.Request, res: express.Res
256async function listVideoChannelVideos (req: express.Request, res: express.Response) { 256async function listVideoChannelVideos (req: express.Request, res: express.Response) {
257 const videoChannelInstance = res.locals.videoChannel 257 const videoChannelInstance = res.locals.videoChannel
258 const followerActorId = isUserAbleToSearchRemoteURI(res) ? null : undefined 258 const followerActorId = isUserAbleToSearchRemoteURI(res) ? null : undefined
259 const countVideos = getCountVideos(req)
259 260
260 const resultList = await VideoModel.listForApi({ 261 const resultList = await VideoModel.listForApi({
261 followerActorId, 262 followerActorId,
@@ -272,7 +273,8 @@ async function listVideoChannelVideos (req: express.Request, res: express.Respon
272 nsfw: buildNSFWFilter(res, req.query.nsfw), 273 nsfw: buildNSFWFilter(res, req.query.nsfw),
273 withFiles: false, 274 withFiles: false,
274 videoChannelId: videoChannelInstance.id, 275 videoChannelId: videoChannelInstance.id,
275 user: res.locals.oauth ? res.locals.oauth.token.User : undefined 276 user: res.locals.oauth ? res.locals.oauth.token.User : undefined,
277 countVideos
276 }) 278 })
277 279
278 return res.json(getFormattedObjects(resultList.data, resultList.total)) 280 return res.json(getFormattedObjects(resultList.data, resultList.total))