mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-11-10 08:36:42 -05:00
47 lines
1.0 KiB
TypeScript
47 lines
1.0 KiB
TypeScript
import { t } from "elysia";
|
|
import { comment } from "../../utils";
|
|
|
|
export const ExternalId = t.Record(
|
|
t.String(),
|
|
t.Object({
|
|
dataId: t.String(),
|
|
link: t.Nullable(t.String({ format: "uri" })),
|
|
}),
|
|
);
|
|
export type ExternalId = typeof ExternalId.static;
|
|
|
|
export const EpisodeId = t.Record(
|
|
t.String(),
|
|
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.Number({
|
|
description: "Null if the external website uses absolute numbering.",
|
|
}),
|
|
),
|
|
episode: t.Number(),
|
|
link: t.Nullable(t.String({ format: "uri" })),
|
|
}),
|
|
);
|
|
export type EpisodeId = typeof EpisodeId.static;
|
|
|
|
export const SeasonId = t.Record(
|
|
t.String(),
|
|
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.Number(),
|
|
link: t.Nullable(t.String({ format: "uri" })),
|
|
}),
|
|
);
|
|
export type SeasonId = typeof SeasonId.static;
|