X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fnotifier%2Fnotifier.ts;h=e34a82603f08001c9f69c874af7f17a11fcd1ab2;hb=1808a1f8e4b7b102823492a2007a46929aebf189;hp=8b68d2e691da14544e457a3a25442da3fe34aa27;hpb=348c2ce3ff3fe2f25a31f08bfb36c88723a0ce46;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/notifier/notifier.ts b/server/lib/notifier/notifier.ts index 8b68d2e69..e34a82603 100644 --- a/server/lib/notifier/notifier.ts +++ b/server/lib/notifier/notifier.ts @@ -12,6 +12,7 @@ import { AbuseStateChangeForReporter, AutoFollowForInstance, CommentMention, + EditionFinishedForOwner, FollowForInstance, FollowForUser, ImportFinishedForOwner, @@ -53,7 +54,8 @@ class Notifier { abuseStateChange: [ AbuseStateChangeForReporter ], newAbuseMessage: [ NewAbuseMessageForReporter, NewAbuseMessageForModerators ], newPeertubeVersion: [ NewPeerTubeVersionForAdmins ], - newPluginVersion: [ NewPluginVersionForAdmins ] + newPluginVersion: [ NewPluginVersionForAdmins ], + videoEditionFinished: [ EditionFinishedForOwner ] } private static instance: Notifier @@ -198,6 +200,13 @@ class Notifier { .catch(err => logger.error('Cannot notify on new plugin version %s.', plugin.name, { err })) } + notifyOfFinishedVideoEdition (video: MVideoFullLight) { + const models = this.notificationModels.videoEditionFinished + + this.sendNotifications(models, video) + .catch(err => logger.error('Cannot notify on finished edition %s.', video.url, { err })) + } + private async notify (object: AbstractNotification) { await object.prepare()