From 06a2e0705acecb74f67283d1b666df7669f2eb84 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Thu, 29 Feb 2024 20:36:27 +0100 Subject: [PATCH] [backend/core] Fix note counter recomputation query --- Iceshrimp.Backend/Core/Services/DatabaseMaintenanceService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Iceshrimp.Backend/Core/Services/DatabaseMaintenanceService.cs b/Iceshrimp.Backend/Core/Services/DatabaseMaintenanceService.cs index 8d81d9aa..0b58a546 100644 --- a/Iceshrimp.Backend/Core/Services/DatabaseMaintenanceService.cs +++ b/Iceshrimp.Backend/Core/Services/DatabaseMaintenanceService.cs @@ -8,7 +8,7 @@ public class DatabaseMaintenanceService(DatabaseContext db) public async Task RecomputeNoteCountersAsync() { await db.Notes.ExecuteUpdateAsync(p => p.SetProperty(n => n.RenoteCount, - n => db.Notes.Count(r => r.IsPureRenote)) + n => db.Notes.Count(r => r.IsPureRenote && r.Renote == n)) .SetProperty(n => n.RepliesCount, n => db.Notes.Count(r => r.Reply == n))); //TODO: update reaction counts as well? (can likely not be done database-side :/)