aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/videos/index.ts')
-rw-r--r--server/controllers/api/videos/index.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts
index 27f67895e..db4f4c96f 100644
--- a/server/controllers/api/videos/index.ts
+++ b/server/controllers/api/videos/index.ts
@@ -295,7 +295,7 @@ async function addVideo (req: express.Request, res: express.Response) {
295} 295}
296 296
297async function updateVideo (req: express.Request, res: express.Response) { 297async function updateVideo (req: express.Request, res: express.Response) {
298 const videoInstance: VideoModel = res.locals.video 298 const videoInstance = res.locals.video
299 const videoFieldsSave = videoInstance.toJSON() 299 const videoFieldsSave = videoInstance.toJSON()
300 const oldVideoAuditView = new VideoAuditView(videoInstance.toFormattedDetailsJSON()) 300 const oldVideoAuditView = new VideoAuditView(videoInstance.toFormattedDetailsJSON())
301 const videoInfoToUpdate: VideoUpdate = req.body 301 const videoInfoToUpdate: VideoUpdate = req.body
@@ -407,7 +407,7 @@ async function updateVideo (req: express.Request, res: express.Response) {
407async function getVideo (req: express.Request, res: express.Response) { 407async function getVideo (req: express.Request, res: express.Response) {
408 // We need more attributes 408 // We need more attributes
409 const userId: number = res.locals.oauth ? res.locals.oauth.token.User.id : null 409 const userId: number = res.locals.oauth ? res.locals.oauth.token.User.id : null
410 const video: VideoModel = await VideoModel.loadForGetAPI(res.locals.video.id, undefined, userId) 410 const video = await VideoModel.loadForGetAPI(res.locals.video.id, undefined, userId)
411 411
412 if (video.isOutdated()) { 412 if (video.isOutdated()) {
413 JobQueue.Instance.createJob({ type: 'activitypub-refresher', payload: { type: 'video', url: video.url } }) 413 JobQueue.Instance.createJob({ type: 'activitypub-refresher', payload: { type: 'video', url: video.url } })
@@ -472,7 +472,7 @@ async function listVideos (req: express.Request, res: express.Response) {
472} 472}
473 473
474async function removeVideo (req: express.Request, res: express.Response) { 474async function removeVideo (req: express.Request, res: express.Response) {
475 const videoInstance: VideoModel = res.locals.video 475 const videoInstance = res.locals.video
476 476
477 await sequelizeTypescript.transaction(async t => { 477 await sequelizeTypescript.transaction(async t => {
478 await videoInstance.destroy({ transaction: t }) 478 await videoInstance.destroy({ transaction: t })