Add ability to set custom field to video form

This commit is contained in:
Chocobozzz 2020-08-20 16:18:16 +02:00 committed by Chocobozzz
parent f95628636b
commit 7294aab0c8
30 changed files with 249 additions and 76 deletions

View file

@ -414,7 +414,7 @@ async function updateVideo (req: express.Request, res: express.Response) {
Notifier.Instance.notifyOnNewVideoIfNeeded(videoInstanceUpdated)
}
Hooks.runAction('action:api.video.updated', { video: videoInstanceUpdated })
Hooks.runAction('action:api.video.updated', { video: videoInstanceUpdated, body: req.body })
} catch (err) {
// Force fields we want to update
// If the transaction is retried, sequelize will think the object has not changed

View file

@ -78,7 +78,10 @@ function videoModelToFormattedJSON (video: MVideoFormattable, options?: VideoFor
userHistory: userHistory ? {
currentTime: userHistory.currentTime
} : undefined
} : undefined,
// Can be added by external plugins
pluginData: (video as any).pluginData
}
if (options) {