From 5e0dbb3e52797cdea7a9069a9dd605c8f84034dd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 17 Jun 2022 16:16:28 +0200 Subject: [PATCH] Fix users stats --- server/models/user/user.ts | 4 ++-- server/models/video/video-comment.ts | 4 ++-- server/models/video/video-playlist.ts | 4 ++-- server/tests/api/server/stats.ts | 4 ++++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/server/models/user/user.ts b/server/models/user/user.ts index 326b2e789..68b2bf523 100644 --- a/server/models/user/user.ts +++ b/server/models/user/user.ts @@ -819,10 +819,10 @@ export class UserModel extends Model>> { } } - return UserModel.count(query) + return UserModel.unscoped().count(query) } - const totalUsers = await UserModel.count() + const totalUsers = await UserModel.unscoped().count() const totalDailyActiveUsers = await getActiveUsers(1) const totalWeeklyActiveUsers = await getActiveUsers(7) const totalMonthlyActiveUsers = await getActiveUsers(30) diff --git a/server/models/video/video-comment.ts b/server/models/video/video-comment.ts index 2d60c6a30..1d3178164 100644 --- a/server/models/video/video-comment.ts +++ b/server/models/video/video-comment.ts @@ -683,11 +683,11 @@ export class VideoCommentModel extends Model