]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/notifier/notifier.ts
Fix email action button label for reports
[github/Chocobozzz/PeerTube.git] / server / lib / notifier / notifier.ts
index 8b68d2e691da14544e457a3a25442da3fe34aa27..a6f13780b424d5d3585e31ce11746cb7108dfa76 100644 (file)
@@ -12,6 +12,7 @@ import {
   AbuseStateChangeForReporter,
   AutoFollowForInstance,
   CommentMention,
+  StudioEditionFinishedForOwner,
   FollowForInstance,
   FollowForUser,
   ImportFinishedForOwner,
@@ -53,7 +54,8 @@ class Notifier {
     abuseStateChange: [ AbuseStateChangeForReporter ],
     newAbuseMessage: [ NewAbuseMessageForReporter, NewAbuseMessageForModerators ],
     newPeertubeVersion: [ NewPeerTubeVersionForAdmins ],
-    newPluginVersion: [ NewPluginVersionForAdmins ]
+    newPluginVersion: [ NewPluginVersionForAdmins ],
+    videoStudioEditionFinished: [ StudioEditionFinishedForOwner ]
   }
 
   private static instance: Notifier
@@ -198,6 +200,13 @@ class Notifier {
       .catch(err => logger.error('Cannot notify on new plugin version %s.', plugin.name, { err }))
   }
 
+  notifyOfFinishedVideoStudioEdition (video: MVideoFullLight) {
+    const models = this.notificationModels.videoStudioEditionFinished
+
+    this.sendNotifications(models, video)
+      .catch(err => logger.error('Cannot notify on finished studio edition %s.', video.url, { err }))
+  }
+
   private async notify <T> (object: AbstractNotification<T>) {
     await object.prepare()