- arguments: [ req, res ],
- errorMessage: 'Cannot insert the video video channel with many retries.'
- }
-
- const videoChannel = await retryTransactionWrapper(addVideoChannel, options)
- return res.json({
- videoChannel: {
- id: videoChannel.id,
- uuid: videoChannel.Actor.uuid
- }
- }).end()
-}
-
-async function addVideoChannel (req: express.Request, res: express.Response) {
- const videoChannelInfo: VideoChannelCreate = req.body
- const account: AccountModel = res.locals.oauth.token.User.Account
-
- const videoChannelCreated: VideoChannelModel = await sequelizeTypescript.transaction(async t => {
- return createVideoChannel(videoChannelInfo, account, t)
- })
-
- setAsyncActorKeys(videoChannelCreated.Actor)
- .catch(err => logger.error('Cannot set async actor keys for account %s.', videoChannelCreated.Actor.uuid, { err }))
-
- logger.info('Video channel with uuid %s created.', videoChannelCreated.Actor.uuid)
-
- return videoChannelCreated
-}
-
-async function updateVideoChannelRetryWrapper (req: express.Request, res: express.Response, next: express.NextFunction) {
- const options = {
- arguments: [ req, res ],
- errorMessage: 'Cannot update the video with many retries.'
+ accountId: res.locals.account.id,
+ start: req.query.start,
+ count: req.query.count,
+ sort: req.query.sort,
+ withStats: req.query.withStats,
+ search: req.query.search