+async function updateVideoChannelAvatar (req: express.Request, res: express.Response, next: express.NextFunction) {
+ const avatarPhysicalFile = req.files[ 'avatarfile' ][ 0 ]
+ const videoChannel = res.locals.videoChannel as VideoChannelModel
+ const oldVideoChannelAuditKeys = new VideoChannelAuditView(videoChannel.toFormattedJSON())
+
+ const avatar = await updateActorAvatarFile(avatarPhysicalFile, videoChannel)
+
+ auditLogger.update(getAuditIdFromRes(res), new VideoChannelAuditView(videoChannel.toFormattedJSON()), oldVideoChannelAuditKeys)
+
+ return res
+ .json({
+ avatar: avatar.toFormattedJSON()
+ })
+ .end()
+}
+