Add entries count in series

This commit is contained in:
Zoe Roux 2025-03-06 17:32:00 +01:00
parent d9e3b3a94b
commit dcf26b94cd
No known key found for this signature in database
4 changed files with 7 additions and 1 deletions

View File

@ -60,6 +60,7 @@ export const seedMovie = async (
startAir: bMovie.airDate,
nextRefresh,
collectionPk: col?.pk,
entriesCount: 1,
...bMovie,
},
translations,

View File

@ -94,6 +94,7 @@ export const seedSerie = async (
kind: "serie",
nextRefresh,
collectionPk: col?.pk,
entriesCount: entries.length,
...serie,
},
translations,

View File

@ -72,6 +72,7 @@ export const shows = schema.table(
collectionPk: integer().references((): AnyPgColumn => shows.pk, {
onDelete: "set null",
}),
entriesCount: integer().notNull(),
externalId: externalid(),

View File

@ -45,6 +45,9 @@ const BaseSerie = t.Object({
),
nextRefresh: t.String({ format: "date-time" }),
entriesCount: t.Integer({
description: "The number of episodes in this serie",
}),
externalId: ExternalId(),
});
@ -82,7 +85,7 @@ export const FullSerie = t.Intersect([
export type FullMovie = Prettify<typeof FullSerie.static>;
export const SeedSerie = t.Intersect([
t.Omit(BaseSerie, ["kind", "nextRefresh"]),
t.Omit(BaseSerie, ["kind", "nextRefresh", "entriesCount"]),
t.Object({
slug: t.String({ format: "slug" }),
translations: TranslationRecord(