aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/notifier/notifier.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-03-22 14:35:04 +0100
committerChocobozzz <me@florianbigard.com>2022-03-22 16:25:14 +0100
commit1808a1f8e4b7b102823492a2007a46929aebf189 (patch)
treea345140ec9a7a20c222ace3cda18ac999277c8c3 /server/lib/notifier/notifier.ts
parent348c2ce3ff3fe2f25a31f08bfb36c88723a0ce46 (diff)
downloadPeerTube-1808a1f8e4b7b102823492a2007a46929aebf189.tar.gz
PeerTube-1808a1f8e4b7b102823492a2007a46929aebf189.tar.zst
PeerTube-1808a1f8e4b7b102823492a2007a46929aebf189.zip
Add video edition finished notification
Diffstat (limited to 'server/lib/notifier/notifier.ts')
-rw-r--r--server/lib/notifier/notifier.ts11
1 files changed, 10 insertions, 1 deletions
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 {
12 AbuseStateChangeForReporter, 12 AbuseStateChangeForReporter,
13 AutoFollowForInstance, 13 AutoFollowForInstance,
14 CommentMention, 14 CommentMention,
15 EditionFinishedForOwner,
15 FollowForInstance, 16 FollowForInstance,
16 FollowForUser, 17 FollowForUser,
17 ImportFinishedForOwner, 18 ImportFinishedForOwner,
@@ -53,7 +54,8 @@ class Notifier {
53 abuseStateChange: [ AbuseStateChangeForReporter ], 54 abuseStateChange: [ AbuseStateChangeForReporter ],
54 newAbuseMessage: [ NewAbuseMessageForReporter, NewAbuseMessageForModerators ], 55 newAbuseMessage: [ NewAbuseMessageForReporter, NewAbuseMessageForModerators ],
55 newPeertubeVersion: [ NewPeerTubeVersionForAdmins ], 56 newPeertubeVersion: [ NewPeerTubeVersionForAdmins ],
56 newPluginVersion: [ NewPluginVersionForAdmins ] 57 newPluginVersion: [ NewPluginVersionForAdmins ],
58 videoEditionFinished: [ EditionFinishedForOwner ]
57 } 59 }
58 60
59 private static instance: Notifier 61 private static instance: Notifier
@@ -198,6 +200,13 @@ class Notifier {
198 .catch(err => logger.error('Cannot notify on new plugin version %s.', plugin.name, { err })) 200 .catch(err => logger.error('Cannot notify on new plugin version %s.', plugin.name, { err }))
199 } 201 }
200 202
203 notifyOfFinishedVideoEdition (video: MVideoFullLight) {
204 const models = this.notificationModels.videoEditionFinished
205
206 this.sendNotifications(models, video)
207 .catch(err => logger.error('Cannot notify on finished edition %s.', video.url, { err }))
208 }
209
201 private async notify <T> (object: AbstractNotification<T>) { 210 private async notify <T> (object: AbstractNotification<T>) {
202 await object.prepare() 211 await object.prepare()
203 212