// ---------------------------------------------------------------------------
-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())
// Force updatedAt attribute change
if (!video.changed()) {
- await video.setAsRefreshed()
+ await video.setAsRefreshed(t)
}
const videoInstanceUpdated = await video.save(sequelizeOptions) as MVideoFullLight
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