Add missing where for image count

This commit is contained in:
barelyprofessional
2026-05-10 17:16:41 -05:00
parent 97e7e5bf17
commit 7eb24e7517

View File

@@ -62,7 +62,7 @@ public class AddImageCommand : ICommand
Key = key, Url = result, LastSeen = DateTimeOffset.MinValue, TagList = tags,
Metadata = new ImageMetadataModel { AddedByUserId = user.Id, WhenAdded = DateTimeOffset.UtcNow }
}, ctx);
var count = await db.Images.CountAsync(cancellationToken: ctx);
var count = await db.Images.Where(i => i.Key == key).CountAsync(cancellationToken: ctx);
await db.SaveChangesAsync(ctx);
await botInstance.SendChatMessageAsync(
$"{user.FormatUsername()}, you added the following media to the {key} carousel which now has {count:N0} images[spoiler=\"Image\"][img]{url}[/img]", true);