diff --git a/api/src/controllers/seed/insert/entries.ts b/api/src/controllers/seed/insert/entries.ts index 3e58fa695..54204ef04 100644 --- a/api/src/controllers/seed/insert/entries.ts +++ b/api/src/controllers/seed/insert/entries.ts @@ -92,6 +92,7 @@ export const insertEntries = record( "id", "slug", "createdAt", + "availableSince", ]), }) .returning({ pk: entries.pk, id: entries.id, slug: entries.slug }); diff --git a/api/src/controllers/shows/logic.ts b/api/src/controllers/shows/logic.ts index f2e17d477..d5eb53e13 100644 --- a/api/src/controllers/shows/logic.ts +++ b/api/src/controllers/shows/logic.ts @@ -1,4 +1,14 @@ -import { and, desc, eq, exists, ne, or, type SQL, sql } from "drizzle-orm"; +import { + and, + desc, + eq, + exists, + isNotNull, + ne, + or, + type SQL, + sql, +} from "drizzle-orm"; import { alias } from "drizzle-orm/pg-core"; import { db } from "~/db"; import { @@ -269,7 +279,13 @@ export const showRelations = { .innerJoin(transQ, eq(entries.pk, transQ.pk)) .leftJoin(entryProgressQ, eq(entries.pk, entryProgressQ.entryPk)) .crossJoinLateral(entryVideosQ) - .where(and(eq(entries.showPk, shows.pk), ne(entries.kind, "extra"))) + .where( + and( + eq(entries.showPk, shows.pk), + ne(entries.kind, "extra"), + isNotNull(entries.availableSince), + ), + ) .orderBy(entries.order) .limit(1) .as("firstEntry"); diff --git a/front/src/ui/details/header.tsx b/front/src/ui/details/header.tsx index 008b33fe6..45a3f3730 100644 --- a/front/src/ui/details/header.tsx +++ b/front/src/ui/details/header.tsx @@ -460,7 +460,7 @@ export const Header = ({ : null } displayNumber={ - data.kind === "serie" + data.kind === "serie" && (data.nextEntry ?? data.firstEntry) ? entryDisplayNumber(data.nextEntry ?? data.firstEntry!) : null }