mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 04:04:21 -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: {
|
ja: {
|
||||||
name: "バブル:2022",
|
name: "バブル:2022",
|
||||||
|
latinName: "Buburu",
|
||||||
tagline: null,
|
tagline: null,
|
||||||
description: null,
|
description: null,
|
||||||
aliases: ["Baburu", "Bubble"],
|
aliases: ["Baburu", "Bubble"],
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { t } from "elysia";
|
import { t } from "elysia";
|
||||||
import type { Prettify } from "~/utils";
|
import { type Prettify, comment } from "~/utils";
|
||||||
import { SeedCollection } from "./collections";
|
import { SeedCollection } from "./collections";
|
||||||
import { bubble, bubbleImages, registerExamples } from "./examples";
|
import { bubble, bubbleImages, registerExamples } from "./examples";
|
||||||
import { SeedStudio, Studio } from "./studio";
|
import { SeedStudio, Studio } from "./studio";
|
||||||
@ -13,6 +13,7 @@ import {
|
|||||||
SeedImage,
|
SeedImage,
|
||||||
TranslationRecord,
|
TranslationRecord,
|
||||||
} from "./utils";
|
} from "./utils";
|
||||||
|
import { Original } from "./utils/orignial";
|
||||||
import { Video } from "./video";
|
import { Video } from "./video";
|
||||||
|
|
||||||
export const MovieStatus = t.UnionEnum(["unknown", "finished", "planned"]);
|
export const MovieStatus = t.UnionEnum(["unknown", "finished", "planned"]);
|
||||||
@ -28,11 +29,6 @@ const BaseMovie = t.Object({
|
|||||||
),
|
),
|
||||||
|
|
||||||
airDate: t.Nullable(t.String({ format: "date" })),
|
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" }),
|
nextRefresh: t.String({ format: "date-time" }),
|
||||||
|
|
||||||
@ -60,6 +56,7 @@ export const Movie = t.Intersect([
|
|||||||
BaseMovie,
|
BaseMovie,
|
||||||
DbMetadata,
|
DbMetadata,
|
||||||
t.Object({
|
t.Object({
|
||||||
|
original: Original,
|
||||||
isAvailable: t.Boolean(),
|
isAvailable: t.Boolean(),
|
||||||
}),
|
}),
|
||||||
]);
|
]);
|
||||||
@ -79,6 +76,9 @@ export const SeedMovie = t.Intersect([
|
|||||||
t.Omit(BaseMovie, ["kind", "nextRefresh"]),
|
t.Omit(BaseMovie, ["kind", "nextRefresh"]),
|
||||||
t.Object({
|
t.Object({
|
||||||
slug: t.String({ format: "slug", examples: ["bubble"] }),
|
slug: t.String({ format: "slug", examples: ["bubble"] }),
|
||||||
|
originalLanguage: Language({
|
||||||
|
description: "The language code this movie was made in.",
|
||||||
|
}),
|
||||||
translations: TranslationRecord(
|
translations: TranslationRecord(
|
||||||
t.Intersect([
|
t.Intersect([
|
||||||
t.Omit(MovieTranslation, ["poster", "thumbnail", "banner", "logo"]),
|
t.Omit(MovieTranslation, ["poster", "thumbnail", "banner", "logo"]),
|
||||||
@ -87,6 +87,7 @@ export const SeedMovie = t.Intersect([
|
|||||||
thumbnail: t.Nullable(SeedImage),
|
thumbnail: t.Nullable(SeedImage),
|
||||||
banner: t.Nullable(SeedImage),
|
banner: t.Nullable(SeedImage),
|
||||||
logo: t.Nullable(SeedImage),
|
logo: t.Nullable(SeedImage),
|
||||||
|
latinName: t.Optional(Original.properties.latinName),
|
||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
|
@ -15,6 +15,7 @@ import {
|
|||||||
SeedImage,
|
SeedImage,
|
||||||
TranslationRecord,
|
TranslationRecord,
|
||||||
} from "./utils";
|
} from "./utils";
|
||||||
|
import { Original } from "./utils/orignial";
|
||||||
|
|
||||||
export const SerieStatus = t.UnionEnum([
|
export const SerieStatus = t.UnionEnum([
|
||||||
"unknown",
|
"unknown",
|
||||||
@ -38,19 +39,8 @@ const BaseSerie = t.Object({
|
|||||||
|
|
||||||
startAir: t.Nullable(t.String({ format: "date" })),
|
startAir: t.Nullable(t.String({ format: "date" })),
|
||||||
endAir: 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" }),
|
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(),
|
externalId: ExternalId(),
|
||||||
});
|
});
|
||||||
@ -75,6 +65,15 @@ export const Serie = t.Intersect([
|
|||||||
SerieTranslation,
|
SerieTranslation,
|
||||||
BaseSerie,
|
BaseSerie,
|
||||||
DbMetadata,
|
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>;
|
export type Serie = Prettify<typeof Serie.static>;
|
||||||
|
|
||||||
@ -88,9 +87,12 @@ export const FullSerie = t.Intersect([
|
|||||||
export type FullMovie = Prettify<typeof FullSerie.static>;
|
export type FullMovie = Prettify<typeof FullSerie.static>;
|
||||||
|
|
||||||
export const SeedSerie = t.Intersect([
|
export const SeedSerie = t.Intersect([
|
||||||
t.Omit(BaseSerie, ["kind", "nextRefresh", "entriesCount", "availableCount"]),
|
t.Omit(BaseSerie, ["kind", "nextRefresh"]),
|
||||||
t.Object({
|
t.Object({
|
||||||
slug: t.String({ format: "slug" }),
|
slug: t.String({ format: "slug" }),
|
||||||
|
originalLanguage: Language({
|
||||||
|
description: "The language code this serie was made in.",
|
||||||
|
}),
|
||||||
translations: TranslationRecord(
|
translations: TranslationRecord(
|
||||||
t.Intersect([
|
t.Intersect([
|
||||||
t.Omit(SerieTranslation, ["poster", "thumbnail", "banner", "logo"]),
|
t.Omit(SerieTranslation, ["poster", "thumbnail", "banner", "logo"]),
|
||||||
@ -99,6 +101,7 @@ export const SeedSerie = t.Intersect([
|
|||||||
thumbnail: t.Nullable(SeedImage),
|
thumbnail: t.Nullable(SeedImage),
|
||||||
banner: t.Nullable(SeedImage),
|
banner: t.Nullable(SeedImage),
|
||||||
logo: 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