From 7294aab0c879ef96c0fde15c389a2c4c1463d3c7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 20 Aug 2020 16:18:16 +0200 Subject: Add ability to set custom field to video form --- server/controllers/api/videos/index.ts | 2 +- server/models/video/video-format-utils.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'server') diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index c05acfd2f..15b6f214f 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts @@ -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 diff --git a/server/models/video/video-format-utils.ts b/server/models/video/video-format-utils.ts index 9b6509dfd..7a17c839f 100644 --- a/server/models/video/video-format-utils.ts +++ b/server/models/video/video-format-utils.ts @@ -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) { -- cgit v1.2.3