Add collection example

This commit is contained in:
Zoe Roux 2025-03-02 17:24:58 +01:00
parent e8c9dfce56
commit 4538d9ce98
No known key found for this signature in database
4 changed files with 44 additions and 4 deletions

View File

@ -1,5 +1,6 @@
import { t } from "elysia";
import type { Prettify } from "elysia/dist/types";
import { bubbleImages, duneCollection, registerExamples } from "./examples";
import {
ExternalId,
Genre,
@ -74,3 +75,9 @@ export const SeedCollection = t.Intersect([
}),
]);
export type SeedCollection = Prettify<typeof SeedCollection.static>;
registerExamples(Collection, {
...duneCollection,
...duneCollection.translations.en,
...bubbleImages,
});

View File

@ -1,5 +1,5 @@
import type { SeedMovie } from "../movie";
import type { Video } from "../video";
import type { SeedMovie } from "~/models/movie";
import type { Video } from "~/models/video";
export const duneVideo: Video = {
id: "c9a0d02e-6b8e-4ac1-b431-45b022ec0708",
@ -38,8 +38,8 @@ export const dune: SeedMovie = {
originalLanguage: "en",
externalId: {
themoviedatabase: {
dataId: "496243",
link: "https://www.themoviedb.org/movie/496243",
dataId: "438631",
link: "https://www.themoviedb.org/movie/438631-dune",
},
imdb: {
dataId: "tt1160419",

View File

@ -0,0 +1,29 @@
import type { SeedCollection } from "~/models/collections";
export const duneCollection: SeedCollection = {
slug: "dune-collection",
translations: {
en: {
name: " Dune Collection",
tagline: "A mythic and emotionally charged hero's journey.",
description:
"The saga of Paul Atreides and his rise to power on the deadly planet Arrakis.",
aliases: [],
tags: ["sci-fi", "adventure", "drama", "action", "epic"],
poster:
"https://image.tmdb.org/t/p/original/wD57HqZ6fXwwDdfQLo4hXLRwGV1.jpg",
thumbnail:
"https://image.tmdb.org/t/p/original/k2ocXnNkmvE6rJomRkExIStFq3v.jpg",
banner: null,
logo: "https://image.tmdb.org/t/p/original/5nDsd3u1c6kDphbtIqkHseLg7HL.png",
},
},
genres: ["adventure", "science-fiction"],
rating: 80,
externalId: {
themoviedatabase: {
dataId: "726871",
link: "https://www.themoviedb.org/collection/726871-dune-collection",
},
},
};

View File

@ -32,3 +32,7 @@ export const registerExamples = <T extends TSchema>(
export * from "./bubble";
export * from "./made-in-abyss";
export * from "./dune-1984";
export * from "./dune-2021";
export * from "./dune-collection";
export * from "./others";