Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Fix totalRepliesFromVideoAuthor SQL request

Chocobozzz562724a1ed13
diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.ts
index c2798e82aa..fb4d16b4d1 100644
--- a/server/models/video/video-comment.ts
+++ b/server/models/video/video-comment.ts
@@ -62,8 +62,10 @@ enum ScopeNames {
'(' +
'SELECT COUNT("replies"."id") ' +
'FROM "videoComment" AS "replies" ' +
+ 'INNER JOIN "video" ON "video"."id" = "replies"."videoId" ' +
+ 'INNER JOIN "videoChannel" ON "videoChannel"."id" = "video"."channelId" ' +
'WHERE "replies"."originCommentId" = "VideoCommentModel"."id" ' +
- 'AND "accountId" = ' + userAccountId +
+ 'AND "replies"."accountId" = "videoChannel"."accountId"' +
')'
),
'totalRepliesFromVideoAuthor'