+ return res.json({
+ // TODO: remove, deprecated in 4.2
+ banner: getBiggestActorImage(banners).toFormattedJSON(),
+ banners: banners.map(b => b.toFormattedJSON())
+ })
+}
+
+async function updateVideoChannelAvatar (req: express.Request, res: express.Response) {
+ const avatarPhysicalFile = req.files['avatarfile'][0]
+ const videoChannel = res.locals.videoChannel
+ const oldVideoChannelAuditKeys = new VideoChannelAuditView(videoChannel.toFormattedJSON())
+
+ const avatars = await updateLocalActorImageFiles(videoChannel, avatarPhysicalFile, ActorImageType.AVATAR)
+ auditLogger.update(getAuditIdFromRes(res), new VideoChannelAuditView(videoChannel.toFormattedJSON()), oldVideoChannelAuditKeys)
+
+ return res.json({
+ // TODO: remove, deprecated in 4.2
+ avatar: getBiggestActorImage(avatars).toFormattedJSON(),
+ avatars: avatars.map(a => a.toFormattedJSON())
+ })
+}
+
+async function deleteVideoChannelAvatar (req: express.Request, res: express.Response) {
+ const videoChannel = res.locals.videoChannel
+
+ await deleteLocalActorImageFile(videoChannel, ActorImageType.AVATAR)
+
+ return res.status(HttpStatusCode.NO_CONTENT_204).end()
+}
+
+async function deleteVideoChannelBanner (req: express.Request, res: express.Response) {
+ const videoChannel = res.locals.videoChannel
+
+ await deleteLocalActorImageFile(videoChannel, ActorImageType.BANNER)
+
+ return res.status(HttpStatusCode.NO_CONTENT_204).end()