From: Chocobozzz Date: Fri, 3 Jan 2020 10:53:51 +0000 (+0100) Subject: Fix totalRepliesFromVideoAuthor SQL request X-Git-Tag: v2.1.0-rc.1~113 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=562724a1ed13fe93aba08ca1a0f8e029819e9f32;p=oweals%2Fpeertube.git Fix totalRepliesFromVideoAuthor SQL request --- diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.ts index c2798e82a..fb4d16b4d 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'