mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-06-05 13:55:18 -04:00
Delete unknown entries, rework them as part of unmatched videos
This commit is contained in:
@@ -17,4 +17,3 @@ export * from "./episode";
|
||||
export * from "./movie-entry";
|
||||
export * from "./special";
|
||||
export * from "./extra";
|
||||
export * from "./unknown-entry";
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
import { t } from "elysia";
|
||||
import { type Prettify, comment } from "~/utils";
|
||||
import { bubbleImages, registerExamples, youtubeExample } from "../examples";
|
||||
import { Progress } from "../history";
|
||||
import { DbMetadata, Resource } from "../utils";
|
||||
import { BaseEntry, EntryTranslation } from "./base-entry";
|
||||
|
||||
export const BaseUnknownEntry = t.Intersect(
|
||||
[
|
||||
t.Object({
|
||||
kind: t.Literal("unknown"),
|
||||
}),
|
||||
t.Omit(BaseEntry(), ["airDate"]),
|
||||
],
|
||||
{
|
||||
description: comment`
|
||||
A video not releated to any series or movie. This can be due to a matching error but it can be a youtube
|
||||
video or any other video content.
|
||||
`,
|
||||
},
|
||||
);
|
||||
|
||||
export const UnknownEntryTranslation = t.Omit(EntryTranslation(), [
|
||||
"description",
|
||||
]);
|
||||
|
||||
export const UnknownEntry = t.Intersect([
|
||||
Resource(),
|
||||
UnknownEntryTranslation,
|
||||
BaseUnknownEntry,
|
||||
t.Object({
|
||||
progress: t.Omit(Progress, ["videoId"]),
|
||||
}),
|
||||
DbMetadata,
|
||||
]);
|
||||
export type UnknownEntry = Prettify<typeof UnknownEntry.static>;
|
||||
|
||||
registerExamples(UnknownEntry, { ...youtubeExample, ...bubbleImages });
|
||||
@@ -35,4 +35,3 @@ export * from "./made-in-abyss";
|
||||
export * from "./dune-1984";
|
||||
export * from "./dune-2021";
|
||||
export * from "./dune-collection";
|
||||
export * from "./others";
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import type { UnknownEntry } from "~/models/entry";
|
||||
|
||||
export const youtubeExample: Partial<UnknownEntry> = {
|
||||
kind: "unknown",
|
||||
// idk if we'll keep non-ascii characters or if we can find a way to convert them
|
||||
slug: "lisa-炎-the-first-take",
|
||||
name: "LiSA - 炎 / THE FIRST TAKE",
|
||||
runtime: 10,
|
||||
thumbnail: null,
|
||||
};
|
||||
@@ -114,7 +114,9 @@ export const SeedVideo = t.Object({
|
||||
export type SeedVideo = Prettify<typeof SeedVideo.static>;
|
||||
|
||||
export const Video = t.Intersect([
|
||||
Resource(),
|
||||
t.Object({
|
||||
id: t.String({ format: "uuid" }),
|
||||
}),
|
||||
t.Omit(SeedVideo, ["for"]),
|
||||
DbMetadata,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user