mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Add original name & latinName
in series/movie
This commit is contained in:
parent
74a509ec03
commit
6b0e3e7577
@ -32,6 +32,7 @@ export const bubble: SeedMovie = {
|
||||
},
|
||||
ja: {
|
||||
name: "バブル:2022",
|
||||
latinName: "Buburu",
|
||||
tagline: null,
|
||||
description: null,
|
||||
aliases: ["Baburu", "Bubble"],
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { t } from "elysia";
|
||||
import type { Prettify } from "~/utils";
|
||||
import { type Prettify, comment } from "~/utils";
|
||||
import { SeedCollection } from "./collections";
|
||||
import { bubble, bubbleImages, registerExamples } from "./examples";
|
||||
import { SeedStudio, Studio } from "./studio";
|
||||
@ -13,6 +13,7 @@ import {
|
||||
SeedImage,
|
||||
TranslationRecord,
|
||||
} from "./utils";
|
||||
import { Original } from "./utils/orignial";
|
||||
import { Video } from "./video";
|
||||
|
||||
export const MovieStatus = t.UnionEnum(["unknown", "finished", "planned"]);
|
||||
@ -28,11 +29,6 @@ const BaseMovie = t.Object({
|
||||
),
|
||||
|
||||
airDate: t.Nullable(t.String({ format: "date" })),
|
||||
originalLanguage: t.Nullable(
|
||||
Language({
|
||||
description: "The language code this movie was made in.",
|
||||
}),
|
||||
),
|
||||
|
||||
nextRefresh: t.String({ format: "date-time" }),
|
||||
|
||||
@ -60,6 +56,7 @@ export const Movie = t.Intersect([
|
||||
BaseMovie,
|
||||
DbMetadata,
|
||||
t.Object({
|
||||
original: Original,
|
||||
isAvailable: t.Boolean(),
|
||||
}),
|
||||
]);
|
||||
@ -79,6 +76,9 @@ export const SeedMovie = t.Intersect([
|
||||
t.Omit(BaseMovie, ["kind", "nextRefresh"]),
|
||||
t.Object({
|
||||
slug: t.String({ format: "slug", examples: ["bubble"] }),
|
||||
originalLanguage: Language({
|
||||
description: "The language code this movie was made in.",
|
||||
}),
|
||||
translations: TranslationRecord(
|
||||
t.Intersect([
|
||||
t.Omit(MovieTranslation, ["poster", "thumbnail", "banner", "logo"]),
|
||||
@ -87,6 +87,7 @@ export const SeedMovie = t.Intersect([
|
||||
thumbnail: t.Nullable(SeedImage),
|
||||
banner: t.Nullable(SeedImage),
|
||||
logo: t.Nullable(SeedImage),
|
||||
latinName: t.Optional(Original.properties.latinName),
|
||||
}),
|
||||
]),
|
||||
),
|
||||
|
@ -15,6 +15,7 @@ import {
|
||||
SeedImage,
|
||||
TranslationRecord,
|
||||
} from "./utils";
|
||||
import { Original } from "./utils/orignial";
|
||||
|
||||
export const SerieStatus = t.UnionEnum([
|
||||
"unknown",
|
||||
@ -38,19 +39,8 @@ const BaseSerie = t.Object({
|
||||
|
||||
startAir: t.Nullable(t.String({ format: "date" })),
|
||||
endAir: t.Nullable(t.String({ format: "date" })),
|
||||
originalLanguage: t.Nullable(
|
||||
Language({
|
||||
description: "The language code this serie was made in.",
|
||||
}),
|
||||
),
|
||||
|
||||
nextRefresh: t.String({ format: "date-time" }),
|
||||
entriesCount: t.Integer({
|
||||
description: "The number of episodes in this serie",
|
||||
}),
|
||||
availableCount: t.Integer({
|
||||
description: "The number of episodes that can be played right away",
|
||||
}),
|
||||
|
||||
externalId: ExternalId(),
|
||||
});
|
||||
@ -75,6 +65,15 @@ export const Serie = t.Intersect([
|
||||
SerieTranslation,
|
||||
BaseSerie,
|
||||
DbMetadata,
|
||||
t.Object({
|
||||
original: Original,
|
||||
entriesCount: t.Integer({
|
||||
description: "The number of episodes in this serie",
|
||||
}),
|
||||
availableCount: t.Integer({
|
||||
description: "The number of episodes that can be played right away",
|
||||
}),
|
||||
}),
|
||||
]);
|
||||
export type Serie = Prettify<typeof Serie.static>;
|
||||
|
||||
@ -88,9 +87,12 @@ export const FullSerie = t.Intersect([
|
||||
export type FullMovie = Prettify<typeof FullSerie.static>;
|
||||
|
||||
export const SeedSerie = t.Intersect([
|
||||
t.Omit(BaseSerie, ["kind", "nextRefresh", "entriesCount", "availableCount"]),
|
||||
t.Omit(BaseSerie, ["kind", "nextRefresh"]),
|
||||
t.Object({
|
||||
slug: t.String({ format: "slug" }),
|
||||
originalLanguage: Language({
|
||||
description: "The language code this serie was made in.",
|
||||
}),
|
||||
translations: TranslationRecord(
|
||||
t.Intersect([
|
||||
t.Omit(SerieTranslation, ["poster", "thumbnail", "banner", "logo"]),
|
||||
@ -99,6 +101,7 @@ export const SeedSerie = t.Intersect([
|
||||
thumbnail: t.Nullable(SeedImage),
|
||||
banner: t.Nullable(SeedImage),
|
||||
logo: t.Nullable(SeedImage),
|
||||
latinName: t.Optional(Original.properties.latinName),
|
||||
}),
|
||||
]),
|
||||
),
|
||||
|
25
api/src/models/utils/orignial.ts
Normal file
25
api/src/models/utils/orignial.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { t } from "elysia";
|
||||
import { comment } from "~/utils";
|
||||
import { Language } from "./language";
|
||||
|
||||
export const Original = t.Object({
|
||||
language: Language({
|
||||
description: "The language code this was made in.",
|
||||
examples: ["ja"]
|
||||
}),
|
||||
name: t.String({
|
||||
description: "The name in the original language",
|
||||
examples: ["進撃の巨人"],
|
||||
}),
|
||||
latinName: t.Nullable(
|
||||
t.String({
|
||||
description: comment`
|
||||
The original name but using latin scripts.
|
||||
This is only set if the original language is written with another
|
||||
alphabet (like japanase, korean, chineses...)
|
||||
`,
|
||||
examples: ["Shingeki no Kyojin"],
|
||||
}),
|
||||
),
|
||||
});
|
||||
export type Original = typeof Original.static;
|
Loading…
x
Reference in New Issue
Block a user