From 8513cc057bc742ee76313abfff1f327cf80d1930 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Mon, 14 Jul 2025 23:19:32 +0200 Subject: [PATCH] Fix seasons `entriesCount` computation --- api/src/controllers/seed/insert/shows.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/src/controllers/seed/insert/shows.ts b/api/src/controllers/seed/insert/shows.ts index 1692e5b8..ac6dda37 100644 --- a/api/src/controllers/seed/insert/shows.ts +++ b/api/src/controllers/seed/insert/shows.ts @@ -209,7 +209,11 @@ export async function updateAvailableCount( .select({ count: count() }) .from(entries) .where( - and(eq(entries.showPk, seasons.showPk), ne(entries.kind, "extra")), + and( + eq(entries.showPk, seasons.showPk), + eq(entries.seasonNumber, seasons.seasonNumber), + ne(entries.kind, "extra"), + ), )}`, }), })