]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/videos/update.ts
Merge branch 'release/4.0.0' into develop
[github/Chocobozzz/PeerTube.git] / server / controllers / api / videos / update.ts
index fab1c226848705496455459dabddda16807ca746..3fcff3e868041a8fc4f589bcd16e873e550ef723 100644 (file)
@@ -51,7 +51,7 @@ export {
 
 // ---------------------------------------------------------------------------
 
-export async function updateVideo (req: express.Request, res: express.Response) {
+async function updateVideo (req: express.Request, res: express.Response) {
   const videoFromReq = res.locals.videoAll
   const videoFieldsSave = videoFromReq.toJSON()
   const oldVideoAuditView = new VideoAuditView(videoFromReq.toFormattedDetailsJSON())
@@ -104,7 +104,7 @@ export async function updateVideo (req: express.Request, res: express.Response)
 
       // Force updatedAt attribute change
       if (!video.changed()) {
-        await video.setAsRefreshed()
+        await video.setAsRefreshed(t)
       }
 
       const videoInstanceUpdated = await video.save(sequelizeOptions) as MVideoFullLight
@@ -153,7 +153,7 @@ export async function updateVideo (req: express.Request, res: express.Response)
       Notifier.Instance.notifyOnNewVideoIfNeeded(videoInstanceUpdated)
     }
 
-    Hooks.runAction('action:api.video.updated', { video: videoInstanceUpdated, body: req.body })
+    Hooks.runAction('action:api.video.updated', { video: videoInstanceUpdated, body: req.body, req, res })
   } catch (err) {
     // Force fields we want to update
     // If the transaction is retried, sequelize will think the object has not changed