diff options
Diffstat (limited to 'server/controllers/api/video-channel.ts')
-rw-r--r-- | server/controllers/api/video-channel.ts | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts index 784f97b1e..7bdb33737 100644 --- a/server/controllers/api/video-channel.ts +++ b/server/controllers/api/video-channel.ts | |||
@@ -1,8 +1,9 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { pickCommonVideoQuery } from '@server/helpers/query' | ||
2 | import { Hooks } from '@server/lib/plugins/hooks' | 3 | import { Hooks } from '@server/lib/plugins/hooks' |
3 | import { getServerActor } from '@server/models/application/application' | 4 | import { getServerActor } from '@server/models/application/application' |
4 | import { MChannelBannerAccountDefault } from '@server/types/models' | 5 | import { MChannelBannerAccountDefault } from '@server/types/models' |
5 | import { ActorImageType, VideoChannelCreate, VideoChannelUpdate, VideosCommonQuery } from '../../../shared' | 6 | import { ActorImageType, VideoChannelCreate, VideoChannelUpdate } from '../../../shared' |
6 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' | 7 | import { HttpStatusCode } from '../../../shared/models/http/http-error-codes' |
7 | import { auditLoggerFactory, getAuditIdFromRes, VideoChannelAuditView } from '../../helpers/audit-logger' | 8 | import { auditLoggerFactory, getAuditIdFromRes, VideoChannelAuditView } from '../../helpers/audit-logger' |
8 | import { resetSequelizeInstance } from '../../helpers/database-utils' | 9 | import { resetSequelizeInstance } from '../../helpers/database-utils' |
@@ -309,20 +310,13 @@ async function listVideoChannelVideos (req: express.Request, res: express.Respon | |||
309 | const videoChannelInstance = res.locals.videoChannel | 310 | const videoChannelInstance = res.locals.videoChannel |
310 | const followerActorId = isUserAbleToSearchRemoteURI(res) ? null : undefined | 311 | const followerActorId = isUserAbleToSearchRemoteURI(res) ? null : undefined |
311 | const countVideos = getCountVideos(req) | 312 | const countVideos = getCountVideos(req) |
312 | const query = req.query as VideosCommonQuery | 313 | const query = pickCommonVideoQuery(req.query) |
313 | 314 | ||
314 | const apiOptions = await Hooks.wrapObject({ | 315 | const apiOptions = await Hooks.wrapObject({ |
316 | ...query, | ||
317 | |||
315 | followerActorId, | 318 | followerActorId, |
316 | start: query.start, | ||
317 | count: query.count, | ||
318 | sort: query.sort, | ||
319 | includeLocalVideos: true, | 319 | includeLocalVideos: true, |
320 | categoryOneOf: query.categoryOneOf, | ||
321 | licenceOneOf: query.licenceOneOf, | ||
322 | languageOneOf: query.languageOneOf, | ||
323 | tagsOneOf: query.tagsOneOf, | ||
324 | tagsAllOf: query.tagsAllOf, | ||
325 | filter: query.filter, | ||
326 | nsfw: buildNSFWFilter(res, query.nsfw), | 320 | nsfw: buildNSFWFilter(res, query.nsfw), |
327 | withFiles: false, | 321 | withFiles: false, |
328 | videoChannelId: videoChannelInstance.id, | 322 | videoChannelId: videoChannelInstance.id, |