+ const blacklist = await VideoBlacklistModel.create(toCreate)
+ blacklist.Video = videoInstance
+
+ if (body.unfederate === true) {
+ await sendDeleteVideo(videoInstance, undefined)
+ }
+
+ Notifier.Instance.notifyOnVideoBlacklist(blacklist)
+
+ logger.info('Video %s blacklisted.', res.locals.video.uuid)
+
+ return res.type('json').status(204).end()
+}
+
+async function updateVideoBlacklistController (req: express.Request, res: express.Response) {
+ const videoBlacklist = res.locals.videoBlacklist
+
+ if (req.body.reason !== undefined) videoBlacklist.reason = req.body.reason
+
+ await sequelizeTypescript.transaction(t => {
+ return videoBlacklist.save({ transaction: t })
+ })
+