diff options
Diffstat (limited to 'server/controllers/api/video-channel.ts')
-rw-r--r-- | server/controllers/api/video-channel.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/server/controllers/api/video-channel.ts b/server/controllers/api/video-channel.ts index 5c96950c5..c48e00232 100644 --- a/server/controllers/api/video-channel.ts +++ b/server/controllers/api/video-channel.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { Hooks } from '@server/lib/plugins/hooks' | ||
2 | import { getServerActor } from '@server/models/application/application' | 3 | import { getServerActor } from '@server/models/application/application' |
3 | import { MChannelAccountDefault } from '@server/types/models' | 4 | import { MChannelAccountDefault } from '@server/types/models' |
4 | import { VideoChannelCreate, VideoChannelUpdate } from '../../../shared' | 5 | import { VideoChannelCreate, VideoChannelUpdate } from '../../../shared' |
@@ -266,7 +267,7 @@ async function listVideoChannelVideos (req: express.Request, res: express.Respon | |||
266 | const followerActorId = isUserAbleToSearchRemoteURI(res) ? null : undefined | 267 | const followerActorId = isUserAbleToSearchRemoteURI(res) ? null : undefined |
267 | const countVideos = getCountVideos(req) | 268 | const countVideos = getCountVideos(req) |
268 | 269 | ||
269 | const resultList = await VideoModel.listForApi({ | 270 | const apiOptions = await Hooks.wrapObject({ |
270 | followerActorId, | 271 | followerActorId, |
271 | start: req.query.start, | 272 | start: req.query.start, |
272 | count: req.query.count, | 273 | count: req.query.count, |
@@ -283,7 +284,13 @@ async function listVideoChannelVideos (req: express.Request, res: express.Respon | |||
283 | videoChannelId: videoChannelInstance.id, | 284 | videoChannelId: videoChannelInstance.id, |
284 | user: res.locals.oauth ? res.locals.oauth.token.User : undefined, | 285 | user: res.locals.oauth ? res.locals.oauth.token.User : undefined, |
285 | countVideos | 286 | countVideos |
286 | }) | 287 | }, 'filter:api.video-channels.videos.list.params') |
288 | |||
289 | const resultList = await Hooks.wrapPromiseFun( | ||
290 | VideoModel.listForApi, | ||
291 | apiOptions, | ||
292 | 'filter:api.video-channels.videos.list.result' | ||
293 | ) | ||
287 | 294 | ||
288 | return res.json(getFormattedObjects(resultList.data, resultList.total)) | 295 | return res.json(getFormattedObjects(resultList.data, resultList.total)) |
289 | } | 296 | } |