Add basic collection routes

This commit is contained in:
Zoe Roux
2025-03-02 19:01:48 +01:00
parent 662400da13
commit d53947265f
5 changed files with 189 additions and 1 deletions
+14
View File
@@ -5,6 +5,7 @@ import {
ExternalId,
Genre,
Image,
Language,
Resource,
SeedImage,
TranslationRecord,
@@ -25,6 +26,11 @@ const BaseCollection = t.Object({
descrpition: "Date of the last item of the collection",
}),
),
originalLanguage: t.Nullable(
Language({
description: "The language code this movie was made in.",
}),
),
createdAt: t.String({ format: "date-time" }),
nextRefresh: t.String({ format: "date-time" }),
@@ -52,6 +58,14 @@ export const Collection = t.Intersect([
]);
export type Collection = Prettify<typeof Collection.static>;
export const FullCollection = t.Intersect([
Collection,
t.Object({
translations: t.Optional(TranslationRecord(CollectionTranslation)),
}),
]);
export type FullCollection = Prettify<typeof FullCollection.static>;
export const SeedCollection = t.Intersect([
t.Omit(BaseCollection, ["startAir", "endAir", "createdAt", "nextRefresh"]),
t.Object({
@@ -18,6 +18,7 @@ export const duneCollection: SeedCollection = {
logo: "https://image.tmdb.org/t/p/original/5nDsd3u1c6kDphbtIqkHseLg7HL.png",
},
},
originalLanguage: "en",
genres: ["adventure", "science-fiction"],
rating: 80,
externalId: {