Match new videos with known metadata

This commit is contained in:
Zoe Roux 2025-05-07 13:49:22 +02:00
parent 6737637f0f
commit ddf4617585
No known key found for this signature in database

View File

@ -5,18 +5,6 @@ import { ExtraType } from "./entry/extra";
import { bubble, bubbleVideo, registerExamples } from "./examples"; import { bubble, bubbleVideo, registerExamples } from "./examples";
import { DbMetadata, EpisodeId, ExternalId, Resource } from "./utils"; import { DbMetadata, EpisodeId, ExternalId, Resource } from "./utils";
const ExternalIds = t.Record(
t.String(),
t.Omit(
t.Union([
EpisodeId.patternProperties[PatternStringExact],
ExternalId().patternProperties[PatternStringExact],
]),
["link"],
),
);
type ExternalIds = typeof ExternalIds.static;
export const Guess = t.Recursive((Self) => export const Guess = t.Recursive((Self) =>
t.Object( t.Object(
{ {
@ -30,7 +18,7 @@ export const Guess = t.Recursive((Self) =>
{ default: [] }, { default: [] },
), ),
), ),
externalId: t.Optional(ExternalIds), externalId: t.Optional(t.String()),
from: t.String({ from: t.String({
description: "Name of the tool that made the guess", description: "Name of the tool that made the guess",
@ -96,7 +84,16 @@ export const SeedVideo = t.Object({
}), }),
}), }),
t.Object({ t.Object({
externalId: ExternalIds, externalId: t.Record(
t.String(),
t.Omit(
t.Union([
EpisodeId.patternProperties[PatternStringExact],
ExternalId().patternProperties[PatternStringExact],
]),
["link"],
),
),
}), }),
t.Object({ t.Object({
movie: t.Union([ movie: t.Union([