aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/video-channel.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-01-08 14:15:16 +0100
committerChocobozzz <me@florianbigard.com>2020-01-08 14:15:16 +0100
commitfe98765624cdd6695739bda719fcb726b71c2b2a (patch)
tree18b19d427e5c25fc9e5290062f307e668f4c9e45 /server/controllers/api/video-channel.ts
parentddc07312b041c1c533b68a919681fc9bce83430d (diff)
downloadPeerTube-fe98765624cdd6695739bda719fcb726b71c2b2a.tar.gz
PeerTube-fe98765624cdd6695739bda719fcb726b71c2b2a.tar.zst
PeerTube-fe98765624cdd6695739bda719fcb726b71c2b2a.zip
Add ability to skip count query
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))