+
+async function listAccountVideos (req: express.Request, res: express.Response) {
+ const account = res.locals.account
+ const followerActorId = isUserAbleToSearchRemoteURI(res) ? null : undefined
+ const countVideos = getCountVideos(req)
+ const query = pickCommonVideoQuery(req.query)
+
+ const apiOptions = await Hooks.wrapObject({
+ ...query,
+
+ followerActorId,
+ search: req.query.search,
+ includeLocalVideos: true,
+ nsfw: buildNSFWFilter(res, query.nsfw),
+ withFiles: false,
+ accountId: account.id,
+ user: res.locals.oauth ? res.locals.oauth.token.User : undefined,
+ countVideos
+ }, 'filter:api.accounts.videos.list.params')
+
+ const resultList = await Hooks.wrapPromiseFun(
+ VideoModel.listForApi,
+ apiOptions,
+ 'filter:api.accounts.videos.list.result'
+ )
+
+ return res.json(getFormattedObjects(resultList.data, resultList.total))
+}
+
+async function listAccountRatings (req: express.Request, res: express.Response) {
+ const account = res.locals.account
+
+ const resultList = await AccountVideoRateModel.listByAccountForApi({
+ accountId: account.id,
+ start: req.query.start,
+ count: req.query.count,
+ sort: req.query.sort,
+ type: req.query.rating
+ })
+ return res.json(getFormattedObjects(resultList.rows, resultList.count))
+}