mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Type extra & allow movie entries to specify a slug on seed
This commit is contained in:
parent
cf59695e09
commit
b1df97f767
@ -20,6 +20,7 @@ const generateSlug = (showSlug: string, entry: SeedEntry): string => {
|
||||
case "special":
|
||||
return `${showSlug}-sp${entry.number}`;
|
||||
case "movie":
|
||||
if (entry.slug) return entry.slug;
|
||||
return entry.order === 1 ? showSlug : `${showSlug}-${entry.order}`;
|
||||
}
|
||||
};
|
||||
|
@ -16,15 +16,3 @@ export const EntryTranslation = t.Object({
|
||||
name: t.Nullable(t.String()),
|
||||
description: t.Nullable(t.String()),
|
||||
});
|
||||
|
||||
// export const SeedEntry = t.Intersect([
|
||||
// Entry,
|
||||
// t.Object({ videos: t.Optional(t.Array(Video)) }),
|
||||
// ]);
|
||||
// export type SeedEntry = typeof SeedEntry.static;
|
||||
//
|
||||
// export const SeedExtra = t.Intersect([
|
||||
// Extra,
|
||||
// t.Object({ video: t.Optional(Video) }),
|
||||
// ]);
|
||||
// export type SeedExtra = typeof SeedExtra.static;
|
||||
|
@ -1,26 +1,25 @@
|
||||
import { t } from "elysia";
|
||||
import { comment } from "../../utils";
|
||||
import { EpisodeId } from "../utils/external-id";
|
||||
import { comment } from "~/utils";
|
||||
import { SeedImage } from "../utils";
|
||||
import { Resource } from "../utils/resource";
|
||||
import { BaseEntry, EntryTranslation } from "./base-entry";
|
||||
import { BaseEntry } from "./base-entry";
|
||||
|
||||
export const ExtraType = t.UnionEnum([
|
||||
"other",
|
||||
"trailers",
|
||||
"trailer",
|
||||
"interview",
|
||||
"behind-the-scenes",
|
||||
"deleted-scenes",
|
||||
"bloopers",
|
||||
"behind-the-scene",
|
||||
"deleted-scene",
|
||||
"blooper",
|
||||
]);
|
||||
export type ExtraType = typeof ExtraType.static;
|
||||
|
||||
export const BaseExtra = t.Intersect(
|
||||
[
|
||||
BaseEntry,
|
||||
t.Omit(BaseEntry, ["nextRefresh", "airDate"]),
|
||||
t.Object({
|
||||
kind: ExtraType,
|
||||
// not sure about this id type
|
||||
externalId: EpisodeId,
|
||||
name: t.String(),
|
||||
}),
|
||||
],
|
||||
{
|
||||
@ -31,5 +30,14 @@ export const BaseExtra = t.Intersect(
|
||||
},
|
||||
);
|
||||
|
||||
export const Extra = t.Intersect([Resource(), BaseExtra, EntryTranslation]);
|
||||
export const Extra = t.Intersect([Resource(), BaseExtra]);
|
||||
export type Extra = typeof Extra.static;
|
||||
|
||||
export const SeedExtra = t.Intersect([
|
||||
t.Omit(BaseExtra, ["thumbnail", "createdAt"]),
|
||||
t.Object({
|
||||
thumbnail: t.Nullable(SeedImage),
|
||||
videos: t.Optional(t.Array(t.String({ format: "uuid" }))),
|
||||
}),
|
||||
]);
|
||||
export type SeedExtra = typeof SeedExtra.static;
|
||||
|
@ -1,13 +1,13 @@
|
||||
import { t } from "elysia";
|
||||
import { comment } from "../../utils";
|
||||
import { BaseEntry, EntryTranslation } from "./base-entry";
|
||||
import {
|
||||
Resource,
|
||||
Image,
|
||||
SeedImage,
|
||||
ExternalId,
|
||||
Image,
|
||||
Resource,
|
||||
SeedImage,
|
||||
TranslationRecord,
|
||||
} from "../utils";
|
||||
import { BaseEntry, EntryTranslation } from "./base-entry";
|
||||
|
||||
export const BaseMovieEntry = t.Intersect(
|
||||
[
|
||||
@ -47,6 +47,7 @@ export type MovieEntry = typeof MovieEntry.static;
|
||||
export const SeedMovieEntry = t.Intersect([
|
||||
t.Omit(BaseMovieEntry, ["thumbnail", "createdAt", "nextRefresh"]),
|
||||
t.Object({
|
||||
slug: t.Optional(t.String({ format: "slug" })),
|
||||
thumbnail: t.Nullable(SeedImage),
|
||||
translations: TranslationRecord(
|
||||
t.Intersect([
|
||||
|
@ -117,22 +117,20 @@ export const madeInAbyss = {
|
||||
entries: [
|
||||
{
|
||||
kind: "episode",
|
||||
id: "ab912364-61c8-4752-ac93-5802212467d8",
|
||||
slug: "made-in-abyss-s1e13",
|
||||
order: 13,
|
||||
seasonNumber: 1,
|
||||
episodeNumber: 13,
|
||||
name: "The Challengers",
|
||||
description:
|
||||
"Nanachi and Mitty's past is revealed. How did they become what they are and who is responsible for it? Meanwhile, Riko is on the mend after her injuries.",
|
||||
translations: {
|
||||
en: {
|
||||
name: "The Challengers",
|
||||
description:
|
||||
"Nanachi and Mitty's past is revealed. How did they become what they are and who is responsible for it? Meanwhile, Riko is on the mend after her injuries.",
|
||||
},
|
||||
},
|
||||
runtime: 47,
|
||||
airDate: "2017-09-29",
|
||||
thumbnail: {
|
||||
id: "c2bfd626-bfdb-dee8-caa6-b6a7e7cb74ad",
|
||||
source:
|
||||
"https://image.tmdb.org/t/p/original/j9t1quh24suXxBetV7Q77YngID6.jpg",
|
||||
blurhash: "L370#nD*^jEN}r$$$%J8i_-URkNc",
|
||||
},
|
||||
thumbnail:
|
||||
"https://image.tmdb.org/t/p/original/j9t1quh24suXxBetV7Q77YngID6.jpg",
|
||||
externalId: {
|
||||
themoviedatabase: {
|
||||
serieId: "72636",
|
||||
@ -141,39 +139,23 @@ export const madeInAbyss = {
|
||||
link: "https://www.themoviedb.org/tv/72636/season/1/episode/13",
|
||||
},
|
||||
},
|
||||
createdAt: "2024-10-06T20:09:09.28103Z",
|
||||
nextRefresh: "2024-12-06T20:08:42.366583Z",
|
||||
videos: [
|
||||
{
|
||||
id: "0905bddd-8b93-403c-9b9c-db472e55d6cc",
|
||||
slug: "made-in-abyss-s1e13",
|
||||
path: "/video/Made in Abyss/Made in Abyss S01E13.mkv",
|
||||
rendering:
|
||||
"e27f226fe5e8d87cd396d0c3d24e1b1135aa563fcfca081bf68c6a71b44de107",
|
||||
part: null,
|
||||
version: 1,
|
||||
createdAt: "2024-10-06T20:09:09.28103Z",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "special",
|
||||
id: "1a83288a-3089-447f-9710-94297d614c51",
|
||||
slug: "made-in-abyss-ova3",
|
||||
// beween s1e13 & movie (which has 13.5 for the `order field`)
|
||||
// between s1e13 & movie (which has 13.5 for the `order field`)
|
||||
order: 13.25,
|
||||
number: 3,
|
||||
name: "Maruruk's Everday 3 - Cleaning",
|
||||
description:
|
||||
"Short played before Made in Abyss Movie 3: Dawn of the Deep Soul in Japan's theatrical screenings before the main movie from 2020-01-17 to 2020-01-23.",
|
||||
translations: {
|
||||
en: {
|
||||
name: "Maruruk's Everday 3 - Cleaning",
|
||||
description:
|
||||
"Short played before Made in Abyss Movie 3: Dawn of the Deep Soul in Japan's theatrical screenings before the main movie from 2020-01-17 to 2020-01-23.",
|
||||
},
|
||||
},
|
||||
runtime: 3,
|
||||
airDate: "2020-01-31",
|
||||
thumbnail: {
|
||||
id: "f4ac4b0a-c857-ea95-4042-601314a26e71",
|
||||
source:
|
||||
"https://image.tmdb.org/t/p/original/4cMeg2ihvACsGVaSUcQJJZd96Je.jpg",
|
||||
blurhash: "LAD,Pg%dc}tPDQfk.7kBo|ayR7WC",
|
||||
},
|
||||
thumbnail:
|
||||
"https://image.tmdb.org/t/p/original/4cMeg2ihvACsGVaSUcQJJZd96Je.jpg",
|
||||
externalId: {
|
||||
themoviedatabase: {
|
||||
serieId: "72636",
|
||||
@ -182,77 +164,48 @@ export const madeInAbyss = {
|
||||
link: "https://www.themoviedb.org/tv/72636/season/0/episode/3",
|
||||
},
|
||||
},
|
||||
createdAt: "2024-10-06T20:09:17.551272Z",
|
||||
nextRefresh: "2024-12-06T20:08:29.463394Z",
|
||||
videos: [
|
||||
{
|
||||
id: "9153f7dc-b635-4a04-a2db-9c08ea205ec3",
|
||||
slug: "made-in-abyss-ova3",
|
||||
path: "/video/Made in Abyss/Made in Abyss S00E03.mkv",
|
||||
rendering:
|
||||
"0391acf2268983de705f65381d252f1b0cd3c3563209303dc50cf71ab400ebf4",
|
||||
part: null,
|
||||
version: 1,
|
||||
createdAt: "2024-10-06T20:09:17.551272Z",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "movie",
|
||||
id: "59312db0-df8c-446e-be26-2b2107d0cbde",
|
||||
slug: "made-in-abyss-dawn-of-the-deep-soul",
|
||||
order: 13.5,
|
||||
name: "Made in Abyss: Dawn of the Deep Soul",
|
||||
tagline: "Defy the darkness",
|
||||
description:
|
||||
"A continuation of the epic adventure of plucky Riko and Reg who are joined by their new friend Nanachi. Together they descend into the Abyss' treacherous fifth layer, the Sea of Corpses, and encounter the mysterious Bondrewd, a legendary White Whistle whose shadow looms over Nanachi's troubled past. Bondrewd is ingratiatingly hospitable, but the brave adventurers know things are not always as they seem in the enigmatic Abyss.",
|
||||
translations: {
|
||||
en: {
|
||||
name: "Made in Abyss: Dawn of the Deep Soul",
|
||||
tagline: "Defy the darkness",
|
||||
description:
|
||||
"A continuation of the epic adventure of plucky Riko and Reg who are joined by their new friend Nanachi. Together they descend into the Abyss' treacherous fifth layer, the Sea of Corpses, and encounter the mysterious Bondrewd, a legendary White Whistle whose shadow looms over Nanachi's troubled past. Bondrewd is ingratiatingly hospitable, but the brave adventurers know things are not always as they seem in the enigmatic Abyss.",
|
||||
poster:
|
||||
"https://image.tmdb.org/t/p/original/4cMeg2ihvACsGVaSUcQJJZd96Je.jpg",
|
||||
},
|
||||
},
|
||||
thumbnail:
|
||||
"https://image.tmdb.org/t/p/original/4cMeg2ihvACsGVaSUcQJJZd96Je.jpg",
|
||||
runtime: 105,
|
||||
airDate: "2020-01-17",
|
||||
poster: {
|
||||
id: "f4ac4b0a-c857-ea95-4042-601314a26e71",
|
||||
source:
|
||||
"https://image.tmdb.org/t/p/original/4cMeg2ihvACsGVaSUcQJJZd96Je.jpg",
|
||||
blurhash: "LAD,Pg%dc}tPDQfk.7kBo|ayR7WC",
|
||||
},
|
||||
externalId: {
|
||||
themoviedatabase: {
|
||||
dataId: "72636",
|
||||
link: "https://www.themoviedb.org/tv/72636/season/0/episode/3",
|
||||
},
|
||||
},
|
||||
createdAt: "2024-10-06T20:09:17.551272Z",
|
||||
nextRefresh: "2024-12-06T20:08:29.463394Z",
|
||||
videos: [
|
||||
{
|
||||
id: "d3cedfc5-23f4-4aab-b4d3-98bef2954442",
|
||||
slug: "made-in-abyss-dawn-of-the-deep-soul",
|
||||
path: "/video/Made in Abyss/Made in Abyss Dawn of the Deep Soul.mkv",
|
||||
rendering:
|
||||
"a59ba5d88a4935d900db312422eec6f16827ce2572cc8c0eb6c8fffc5e235d6d",
|
||||
part: null,
|
||||
version: 1,
|
||||
createdAt: "2024-10-06T20:09:17.551272Z",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
kind: "episode",
|
||||
id: "bd155be3-39d0-4253-bb29-a60bedb62943",
|
||||
slug: "made-in-abyss-s2e1",
|
||||
order: 14,
|
||||
seasonNumber: 2,
|
||||
episodeNumber: 1,
|
||||
name: "The Compass Pointed to the Darkness",
|
||||
description:
|
||||
"An old man speaks of a golden city that lies within a devouring abyss somewhere in uncharted waters. One explorer may be the key to finding both.",
|
||||
translations: {
|
||||
en: {
|
||||
name: "The Compass Pointed to the Darkness",
|
||||
description:
|
||||
"An old man speaks of a golden city that lies within a devouring abyss somewhere in uncharted waters. One explorer may be the key to finding both.",
|
||||
},
|
||||
},
|
||||
runtime: 23,
|
||||
airDate: "2022-07-06",
|
||||
thumbnail: {
|
||||
id: "072da617-f349-4a68-eb27-d097624b373c",
|
||||
source:
|
||||
"https://image.tmdb.org/t/p/original/Tgu6E3aMf7sFHFbEIMEjetnpMi.jpg",
|
||||
blurhash: "LOI#x]yE01xtE2D*kWt7NGjENGM|",
|
||||
},
|
||||
thumbnail:
|
||||
"https://image.tmdb.org/t/p/original/Tgu6E3aMf7sFHFbEIMEjetnpMi.jpg",
|
||||
externalId: {
|
||||
themoviedatabase: {
|
||||
serieId: "72636",
|
||||
@ -261,62 +214,14 @@ export const madeInAbyss = {
|
||||
link: "https://www.themoviedb.org/tv/72636/season/2/episode/1",
|
||||
},
|
||||
},
|
||||
createdAt: "2024-10-06T20:09:05.651996Z",
|
||||
nextRefresh: "2024-12-06T20:08:22.854073Z",
|
||||
videos: [
|
||||
{
|
||||
id: "3cbcc337-f1da-486a-93bd-c705a58545eb",
|
||||
slug: "made-in-abyss-s2e1-p1",
|
||||
path: "/video/Made in Abyss/Made In Abyss S02E01 Part 1.mkv",
|
||||
rendering:
|
||||
"6239d558696fd1cbcd70a67346e748382fe141bbe7ea01a5d702cdcc02aa996f",
|
||||
part: 1,
|
||||
version: 1,
|
||||
createdAt: "2024-10-06T20:09:05.651996Z",
|
||||
},
|
||||
{
|
||||
id: "67b37a00-7459-4287-9bbf-e058675850b5",
|
||||
slug: "made-in-abyss-s2e1-p2",
|
||||
path: "/video/Made in Abyss/Made In Abyss S02E01 Part 2.mkv",
|
||||
rendering:
|
||||
"6239d558696fd1cbcd70a67346e748382fe141bbe7ea01a5d702cdcc02aa996f",
|
||||
part: 2,
|
||||
version: 1,
|
||||
createdAt: "2024-10-06T20:09:05.651996Z",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
extras: [
|
||||
{
|
||||
kind: "behind-the-scenes",
|
||||
id: "a9b27fcc-9423-44ad-b875-d35a7a25b613",
|
||||
slug: "made-in-abyss-the-making-of-01",
|
||||
kind: "behind-the-scene",
|
||||
name: "The Making of MADE IN ABYSS 01",
|
||||
description: null,
|
||||
runtime: 17,
|
||||
airDate: "2017-10-25",
|
||||
thumbnail: null,
|
||||
externalId: {
|
||||
themoviedatabase: {
|
||||
serieId: "72636",
|
||||
season: 0,
|
||||
episode: 13,
|
||||
link: "https://thetvdb.com/series/made-in-abyss/episodes/8835068",
|
||||
},
|
||||
},
|
||||
createdAt: "2024-10-06T20:09:05.651996Z",
|
||||
nextRefresh: "2024-12-06T20:08:22.854073Z",
|
||||
video: {
|
||||
id: "ee3f58eb-0f72-423e-b247-0695cfabfa88",
|
||||
slug: "made-in-abyss-s2e1-p2",
|
||||
path: "/video/Made in Abyss/Made In Abyss S02E01 Part 2.mkv",
|
||||
rendering:
|
||||
"6239d558696fd1cbcd70a67346e748382fe141bbe7ea01a5d702cdcc02aa996f",
|
||||
part: 2,
|
||||
version: 1,
|
||||
createdAt: "2024-10-06T20:09:05.651996Z",
|
||||
},
|
||||
},
|
||||
],
|
||||
} satisfies SeedSerie;
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { t } from "elysia";
|
||||
import { SeedEntry, SeedExtra } from "./entry";
|
||||
import { bubbleImages, madeInAbyss, registerExamples } from "./examples";
|
||||
import { SeedSeason } from "./season";
|
||||
import { ExternalId } from "./utils/external-id";
|
||||
@ -6,7 +7,6 @@ import { Genre } from "./utils/genres";
|
||||
import { Image, SeedImage } from "./utils/image";
|
||||
import { Language, TranslationRecord } from "./utils/language";
|
||||
import { Resource } from "./utils/resource";
|
||||
import { SeedEntry } from "./entry";
|
||||
|
||||
export const SerieStatus = t.UnionEnum([
|
||||
"unknown",
|
||||
@ -76,7 +76,7 @@ export const SeedSerie = t.Intersect([
|
||||
),
|
||||
seasons: t.Array(SeedSeason),
|
||||
entries: t.Array(SeedEntry),
|
||||
// extras: t.Optional(t.Array(SeedExtra)),
|
||||
extras: t.Optional(t.Array(SeedExtra)),
|
||||
}),
|
||||
]);
|
||||
export type SeedSerie = typeof SeedSerie.static;
|
||||
|
Loading…
x
Reference in New Issue
Block a user