+
+async function listVideoChannelVideos (req: express.Request, res: express.Response) {
+ const videoChannelInstance = res.locals.videoChannel
+ const followerActorId = isUserAbleToSearchRemoteURI(res) ? null : undefined
+ const countVideos = getCountVideos(req)
+ const query = req.query as VideosCommonQuery
+
+ const apiOptions = await Hooks.wrapObject({
+ followerActorId,
+ start: query.start,
+ count: query.count,
+ sort: query.sort,
+ includeLocalVideos: true,
+ categoryOneOf: query.categoryOneOf,
+ licenceOneOf: query.licenceOneOf,
+ languageOneOf: query.languageOneOf,
+ tagsOneOf: query.tagsOneOf,
+ tagsAllOf: query.tagsAllOf,
+ filter: query.filter,
+ nsfw: buildNSFWFilter(res, query.nsfw),
+ withFiles: false,
+ videoChannelId: videoChannelInstance.id,
+ user: res.locals.oauth ? res.locals.oauth.token.User : undefined,
+ countVideos
+ }, 'filter:api.video-channels.videos.list.params')
+
+ const resultList = await Hooks.wrapPromiseFun(
+ VideoModel.listForApi,
+ apiOptions,
+ 'filter:api.video-channels.videos.list.result'
+ )
+
+ return res.json(getFormattedObjects(resultList.data, resultList.total))
+}