Allow entry movies to have episodeid

This commit is contained in:
Zoe Roux 2026-01-12 15:11:52 +01:00
parent cc60b429b4
commit ec659c3f2f
No known key found for this signature in database
2 changed files with 27 additions and 2 deletions

View File

@ -4,8 +4,8 @@ import { bubbleImages, madeInAbyss, registerExamples } from "../examples";
import { Progress } from "../history";
import {
DbMetadata,
ExternalId,
Image,
MovieEpisodeId,
Resource,
SeedImage,
TranslationRecord,
@ -20,7 +20,7 @@ export const BaseMovieEntry = t.Composite(
order: t.Number({
description: "Absolute playback order. Can be mixed with episodes.",
}),
externalId: ExternalId(),
externalId: MovieEpisodeId,
}),
BaseEntry(),
],

View File

@ -30,6 +30,31 @@ export const EpisodeId = t.Record(
);
export type EpisodeId = typeof EpisodeId.static;
export const MovieEpisodeId = t.Record(
t.String(),
t.Union([
t.Object({
dataId: t.String(),
link: t.Nullable(t.String({ format: "uri" })),
}),
t.Object({
serieId: t.String({
descrpition: comment`
Id on the external website.
We store the serie's id because episode id are rarely stable.
`,
}),
season: t.Nullable(
t.Integer({
description: "Null if the external website uses absolute numbering.",
}),
),
episode: t.Integer(),
link: t.Nullable(t.String({ format: "uri" })),
}),
]),
);
export const SeasonId = t.Record(
t.String(),
t.Object({