X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=server%2Fcontrollers%2Fapi%2Fvideos%2Findex.ts;h=7a9cd9d37486b03a01512b2a19376181c1f22a49;hb=6d33593a0829a7f041127d50d4c455456550a47f;hp=3a19fe989b303a448145d846e11291cc2e26dafd;hpb=e95561cdf195d2926e1856ed285c2b86960bc86f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 3a19fe989..7a9cd9d37 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts @@ -157,6 +157,7 @@ function addVideoRetryWrapper (req: express.Request, res: express.Response, next function addVideo (req: express.Request, res: express.Response, videoPhysicalFile: Express.Multer.File) { const videoInfo: VideoCreate = req.body + let videoUUID = '' return db.sequelize.transaction(t => { const user = res.locals.oauth.token.User @@ -241,6 +242,7 @@ function addVideo (req: express.Request, res: express.Response, videoPhysicalFil .then(videoCreated => { // Do not forget to add Author information to the created video videoCreated.Author = author + videoUUID = videoCreated.uuid return { tagInstances, video: videoCreated, videoFile } }) @@ -274,7 +276,7 @@ function addVideo (req: express.Request, res: express.Response, videoPhysicalFil }) }) }) - .then(() => logger.info('Video with name %s created.', videoInfo.name)) + .then(() => logger.info('Video with name %s and uuid %s created.', videoInfo.name, videoUUID)) .catch((err: Error) => { logger.debug('Cannot insert the video.', err) throw err @@ -342,7 +344,7 @@ function updateVideo (req: express.Request, res: express.Response) { }) }) .then(() => { - logger.info('Video with name %s updated.', videoInstance.name) + logger.info('Video with name %s and uuid %s updated.', videoInstance.name, videoInstance.uuid) }) .catch(err => { logger.debug('Cannot update the video.', err) @@ -398,7 +400,10 @@ function removeVideo (req: express.Request, res: express.Response, next: express const videoInstance = res.locals.video videoInstance.destroy() - .then(() => res.type('json').status(204).end()) + .then(() => { + logger.info('Video with name %s and uuid %s deleted.', videoInstance.name, videoInstance.uuid) + res.type('json').status(204).end() + }) .catch(err => { logger.error('Errors when removed the video.', err) return next(err)