aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/video-channel.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-03 11:06:19 +0200
committerChocobozzz <me@florianbigard.com>2021-05-03 16:42:15 +0200
commit1fd61899eaea245a5844e33e21f04b2562f16e5e (patch)
tree2a1d51b37b12219cade35e189d62686cd0fec105 /server/controllers/api/video-channel.ts
parentdfcb6f50a607b6b402b4f8fa3d43792d61c912a5 (diff)
downloadPeerTube-1fd61899eaea245a5844e33e21f04b2562f16e5e.tar.gz
PeerTube-1fd61899eaea245a5844e33e21f04b2562f16e5e.tar.zst
PeerTube-1fd61899eaea245a5844e33e21f04b2562f16e5e.zip
Add ability to filter my videos by live
Diffstat (limited to 'server/controllers/api/video-channel.ts')
-rw-r--r--server/controllers/api/video-channel.ts23
1 files changed, 12 insertions, 11 deletions
diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts
index 149d6cfb4..a755d7e57 100644
--- a/server/controllers/api/video-channel.ts
+++ b/server/controllers/api/video-channel.ts
@@ -2,7 +2,7 @@ import * as express from 'express'
2import { Hooks } from '@server/lib/plugins/hooks' 2import { Hooks } from '@server/lib/plugins/hooks'
3import { getServerActor } from '@server/models/application/application' 3import { getServerActor } from '@server/models/application/application'
4import { MChannelBannerAccountDefault } from '@server/types/models' 4import { MChannelBannerAccountDefault } from '@server/types/models'
5import { ActorImageType, VideoChannelCreate, VideoChannelUpdate } from '../../../shared' 5import { ActorImageType, VideoChannelCreate, VideoChannelUpdate, VideosCommonQuery } from '../../../shared'
6import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' 6import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
7import { auditLoggerFactory, getAuditIdFromRes, VideoChannelAuditView } from '../../helpers/audit-logger' 7import { auditLoggerFactory, getAuditIdFromRes, VideoChannelAuditView } from '../../helpers/audit-logger'
8import { resetSequelizeInstance } from '../../helpers/database-utils' 8import { resetSequelizeInstance } from '../../helpers/database-utils'
@@ -312,20 +312,21 @@ async function listVideoChannelVideos (req: express.Request, res: express.Respon
312 const videoChannelInstance = res.locals.videoChannel 312 const videoChannelInstance = res.locals.videoChannel
313 const followerActorId = isUserAbleToSearchRemoteURI(res) ? null : undefined 313 const followerActorId = isUserAbleToSearchRemoteURI(res) ? null : undefined
314 const countVideos = getCountVideos(req) 314 const countVideos = getCountVideos(req)
315 const query = req.query as VideosCommonQuery
315 316
316 const apiOptions = await Hooks.wrapObject({ 317 const apiOptions = await Hooks.wrapObject({
317 followerActorId, 318 followerActorId,
318 start: req.query.start, 319 start: query.start,
319 count: req.query.count, 320 count: query.count,
320 sort: req.query.sort, 321 sort: query.sort,
321 includeLocalVideos: true, 322 includeLocalVideos: true,
322 categoryOneOf: req.query.categoryOneOf, 323 categoryOneOf: query.categoryOneOf,
323 licenceOneOf: req.query.licenceOneOf, 324 licenceOneOf: query.licenceOneOf,
324 languageOneOf: req.query.languageOneOf, 325 languageOneOf: query.languageOneOf,
325 tagsOneOf: req.query.tagsOneOf, 326 tagsOneOf: query.tagsOneOf,
326 tagsAllOf: req.query.tagsAllOf, 327 tagsAllOf: query.tagsAllOf,
327 filter: req.query.filter, 328 filter: query.filter,
328 nsfw: buildNSFWFilter(res, req.query.nsfw), 329 nsfw: buildNSFWFilter(res, query.nsfw),
329 withFiles: false, 330 withFiles: false,
330 videoChannelId: videoChannelInstance.id, 331 videoChannelId: videoChannelInstance.id,
331 user: res.locals.oauth ? res.locals.oauth.token.User : undefined, 332 user: res.locals.oauth ? res.locals.oauth.token.User : undefined,