]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-comment.ts
Add filter inputs for blacklisted videos and muted accounts/servers
[github/Chocobozzz/PeerTube.git] / server / models / video / video-comment.ts
index b33c33d5efa002bc52f618584cefcfe508fa70a8..7cdff8c2cbefb6ba6d162d4b89cf83d6c1be8e31 100644 (file)
@@ -27,6 +27,7 @@ import {
   MCommentOwnerVideoReply
 } from '../../typings/models/video'
 import { MUserAccountId } from '@server/typings/models'
+import { VideoPrivacy } from '@shared/models'
 
 enum ScopeNames {
   WITH_ACCOUNT = 'WITH_ACCOUNT',
@@ -385,12 +386,17 @@ export class VideoCommentModel extends Model<VideoCommentModel> {
       order: [ [ 'createdAt', 'DESC' ] ] as Order,
       offset: start,
       limit: count,
-      where: {},
+      where: {
+        deletedAt: null
+      },
       include: [
         {
           attributes: [ 'name', 'uuid' ],
           model: VideoModel.unscoped(),
-          required: true
+          required: true,
+          where: {
+            privacy: VideoPrivacy.PUBLIC
+          }
         }
       ]
     }