mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-11-23 06:53:09 -05:00
34 lines
881 B
TypeScript
34 lines
881 B
TypeScript
import { t } from "elysia";
|
|
|
|
export const WatchlistStatus = t.UnionEnum([
|
|
"completed",
|
|
"watching",
|
|
"rewatching",
|
|
"dropped",
|
|
"planned",
|
|
]);
|
|
export type WatchlistStatus = typeof WatchlistStatus.static;
|
|
|
|
export const SerieWatchStatus = t.Object({
|
|
status: WatchlistStatus,
|
|
score: t.Nullable(t.Integer({ minimum: 0, maximum: 100 })),
|
|
startedAt: t.Nullable(t.String({ format: "date-time" })),
|
|
completedAt: t.Nullable(t.String({ format: "date-time" })),
|
|
seenCount: t.Integer({
|
|
description: "The number of episodes you watched in this serie.",
|
|
minimum: 0,
|
|
}),
|
|
});
|
|
export type SerieWatchStatus = typeof SerieWatchStatus.static;
|
|
|
|
export const MovieWatchStatus = t.Composite([
|
|
t.Omit(SerieWatchStatus, ["startedAt", "seenCount"]),
|
|
t.Object({
|
|
percent: t.Integer({
|
|
minimum: 0,
|
|
maximum: 100,
|
|
}),
|
|
}),
|
|
]);
|
|
export type MovieWatchStatus = typeof MovieWatchStatus.static;
|