diff options
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/activitypub/videos/shared/creator.ts | 3 | ||||
-rw-r--r-- | server/lib/activitypub/videos/updater.ts | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/server/lib/activitypub/videos/shared/creator.ts b/server/lib/activitypub/videos/shared/creator.ts index 07252fea2..77321d8a5 100644 --- a/server/lib/activitypub/videos/shared/creator.ts +++ b/server/lib/activitypub/videos/shared/creator.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | 1 | ||
2 | import { logger, loggerTagsFactory, LoggerTagsFn } from '@server/helpers/logger' | 2 | import { logger, loggerTagsFactory, LoggerTagsFn } from '@server/helpers/logger' |
3 | import { sequelizeTypescript } from '@server/initializers/database' | 3 | import { sequelizeTypescript } from '@server/initializers/database' |
4 | import { Hooks } from '@server/lib/plugins/hooks' | ||
4 | import { autoBlacklistVideoIfNeeded } from '@server/lib/video-blacklist' | 5 | import { autoBlacklistVideoIfNeeded } from '@server/lib/video-blacklist' |
5 | import { VideoModel } from '@server/models/video/video' | 6 | import { VideoModel } from '@server/models/video/video' |
6 | import { MThumbnail, MVideoFullLight, MVideoThumbnail } from '@server/types/models' | 7 | import { MThumbnail, MVideoFullLight, MVideoThumbnail } from '@server/types/models' |
@@ -61,6 +62,8 @@ export class APVideoCreator extends APVideoAbstractBuilder { | |||
61 | 62 | ||
62 | logger.info('Remote video with uuid %s inserted.', this.videoObject.uuid, this.lTags()) | 63 | logger.info('Remote video with uuid %s inserted.', this.videoObject.uuid, this.lTags()) |
63 | 64 | ||
65 | Hooks.runAction('action:activity-pub.remote-video.created', { video: videoCreated, videoAPObject: this.videoObject }) | ||
66 | |||
64 | return { autoBlacklisted, videoCreated } | 67 | return { autoBlacklisted, videoCreated } |
65 | } catch (err) { | 68 | } catch (err) { |
66 | // FIXME: Use rollback hook when https://github.com/sequelize/sequelize/pull/13038 is released | 69 | // FIXME: Use rollback hook when https://github.com/sequelize/sequelize/pull/13038 is released |
diff --git a/server/lib/activitypub/videos/updater.ts b/server/lib/activitypub/videos/updater.ts index 0bf32f440..3677dc3bb 100644 --- a/server/lib/activitypub/videos/updater.ts +++ b/server/lib/activitypub/videos/updater.ts | |||
@@ -3,6 +3,7 @@ import { resetSequelizeInstance, runInReadCommittedTransaction } from '@server/h | |||
3 | import { logger, loggerTagsFactory, LoggerTagsFn } from '@server/helpers/logger' | 3 | import { logger, loggerTagsFactory, LoggerTagsFn } from '@server/helpers/logger' |
4 | import { Notifier } from '@server/lib/notifier' | 4 | import { Notifier } from '@server/lib/notifier' |
5 | import { PeerTubeSocket } from '@server/lib/peertube-socket' | 5 | import { PeerTubeSocket } from '@server/lib/peertube-socket' |
6 | import { Hooks } from '@server/lib/plugins/hooks' | ||
6 | import { autoBlacklistVideoIfNeeded } from '@server/lib/video-blacklist' | 7 | import { autoBlacklistVideoIfNeeded } from '@server/lib/video-blacklist' |
7 | import { VideoLiveModel } from '@server/models/video/video-live' | 8 | import { VideoLiveModel } from '@server/models/video/video-live' |
8 | import { MActor, MChannelAccountLight, MChannelId, MVideoAccountLightBlacklistAllFiles, MVideoFullLight } from '@server/types/models' | 9 | import { MActor, MChannelAccountLight, MChannelId, MVideoAccountLightBlacklistAllFiles, MVideoFullLight } from '@server/types/models' |
@@ -81,6 +82,8 @@ export class APVideoUpdater extends APVideoAbstractBuilder { | |||
81 | PeerTubeSocket.Instance.sendVideoLiveNewState(videoUpdated) | 82 | PeerTubeSocket.Instance.sendVideoLiveNewState(videoUpdated) |
82 | } | 83 | } |
83 | 84 | ||
85 | Hooks.runAction('action:activity-pub.remote-video.updated', { video: videoUpdated, videoAPObject: this.videoObject }) | ||
86 | |||
84 | logger.info('Remote video with uuid %s updated', this.videoObject.uuid, this.lTags()) | 87 | logger.info('Remote video with uuid %s updated', this.videoObject.uuid, this.lTags()) |
85 | 88 | ||
86 | return videoUpdated | 89 | return videoUpdated |