Delete unknown entries, rework them as part of unmatched videos

This commit is contained in:
Zoe Roux
2025-04-30 14:52:17 +02:00
parent 1fca8957a2
commit 6194d806cc
8 changed files with 65 additions and 105 deletions
-1
View File
@@ -17,4 +17,3 @@ export * from "./episode";
export * from "./movie-entry";
export * from "./special";
export * from "./extra";
export * from "./unknown-entry";
-38
View File
@@ -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 });
-1
View File
@@ -35,4 +35,3 @@ export * from "./made-in-abyss";
export * from "./dune-1984";
export * from "./dune-2021";
export * from "./dune-collection";
export * from "./others";
-10
View File
@@ -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,
};
+3 -1
View File
@@ -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,
]);