diff options
Diffstat (limited to 'server/controllers/api/video-channel.ts')
-rw-r--r-- | server/controllers/api/video-channel.ts | 6 |
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 | |||
20 | import { sendUpdateActor } from '../../lib/activitypub/send' | 20 | import { sendUpdateActor } from '../../lib/activitypub/send' |
21 | import { VideoChannelCreate, VideoChannelUpdate } from '../../../shared' | 21 | import { VideoChannelCreate, VideoChannelUpdate } from '../../../shared' |
22 | import { createLocalVideoChannel, federateAllVideosOfChannel } from '../../lib/video-channel' | 22 | import { createLocalVideoChannel, federateAllVideosOfChannel } from '../../lib/video-channel' |
23 | import { buildNSFWFilter, createReqFiles, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils' | 23 | import { buildNSFWFilter, createReqFiles, getCountVideos, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils' |
24 | import { setAsyncActorKeys } from '../../lib/activitypub' | 24 | import { setAsyncActorKeys } from '../../lib/activitypub' |
25 | import { AccountModel } from '../../models/account/account' | 25 | import { AccountModel } from '../../models/account/account' |
26 | import { MIMETYPES } from '../../initializers/constants' | 26 | import { MIMETYPES } from '../../initializers/constants' |
@@ -256,6 +256,7 @@ async function listVideoChannelPlaylists (req: express.Request, res: express.Res | |||
256 | async function listVideoChannelVideos (req: express.Request, res: express.Response) { | 256 | async 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)) |