diff options
Diffstat (limited to 'server/controllers/api/video-channel.ts')
-rw-r--r-- | server/controllers/api/video-channel.ts | 23 |
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' | |||
2 | import { Hooks } from '@server/lib/plugins/hooks' | 2 | import { Hooks } from '@server/lib/plugins/hooks' |
3 | import { getServerActor } from '@server/models/application/application' | 3 | import { getServerActor } from '@server/models/application/application' |
4 | import { MChannelBannerAccountDefault } from '@server/types/models' | 4 | import { MChannelBannerAccountDefault } from '@server/types/models' |
5 | import { ActorImageType, VideoChannelCreate, VideoChannelUpdate } from '../../../shared' | 5 | import { ActorImageType, VideoChannelCreate, VideoChannelUpdate, VideosCommonQuery } from '../../../shared' |
6 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | 6 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' |
7 | import { auditLoggerFactory, getAuditIdFromRes, VideoChannelAuditView } from '../../helpers/audit-logger' | 7 | import { auditLoggerFactory, getAuditIdFromRes, VideoChannelAuditView } from '../../helpers/audit-logger' |
8 | import { resetSequelizeInstance } from '../../helpers/database-utils' | 8 | import { 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, |