]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/account/user-notification-setting.ts
Add import finished and video published notifs
[github/Chocobozzz/PeerTube.git] / server / models / account / user-notification-setting.ts
index bc24b1e3360df8cf4e435e2e5bd1af629df3f8d3..6470defa75c927319dc203e0b9ecb95e02e67c59 100644 (file)
@@ -65,6 +65,24 @@ export class UserNotificationSettingModel extends Model<UserNotificationSettingM
   @Column
   blacklistOnMyVideo: UserNotificationSettingValue
 
+  @AllowNull(false)
+  @Default(null)
+  @Is(
+    'UserNotificationSettingMyVideoPublished',
+    value => throwIfNotValid(value, isUserNotificationSettingValid, 'myVideoPublished')
+  )
+  @Column
+  myVideoPublished: UserNotificationSettingValue
+
+  @AllowNull(false)
+  @Default(null)
+  @Is(
+    'UserNotificationSettingMyVideoImportFinished',
+    value => throwIfNotValid(value, isUserNotificationSettingValid, 'myVideoImportFinished')
+  )
+  @Column
+  myVideoImportFinished: UserNotificationSettingValue
+
   @ForeignKey(() => UserModel)
   @Column
   userId: number
@@ -94,7 +112,9 @@ export class UserNotificationSettingModel extends Model<UserNotificationSettingM
       newCommentOnMyVideo: this.newCommentOnMyVideo,
       newVideoFromSubscription: this.newVideoFromSubscription,
       videoAbuseAsModerator: this.videoAbuseAsModerator,
-      blacklistOnMyVideo: this.blacklistOnMyVideo
+      blacklistOnMyVideo: this.blacklistOnMyVideo,
+      myVideoPublished: this.myVideoPublished,
+      myVideoImportFinished: this.myVideoImportFinished
     }
   }
 }