From ddf46175855e27c2e5e691f87bf6b788e203ef9b Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Wed, 7 May 2025 13:49:22 +0200 Subject: [PATCH] Match new videos with known metadata --- api/src/models/video.ts | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/api/src/models/video.ts b/api/src/models/video.ts index 8d14e909..8cb425a9 100644 --- a/api/src/models/video.ts +++ b/api/src/models/video.ts @@ -5,18 +5,6 @@ import { ExtraType } from "./entry/extra"; import { bubble, bubbleVideo, registerExamples } from "./examples"; 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) => t.Object( { @@ -30,7 +18,7 @@ export const Guess = t.Recursive((Self) => { default: [] }, ), ), - externalId: t.Optional(ExternalIds), + externalId: t.Optional(t.String()), from: t.String({ description: "Name of the tool that made the guess", @@ -96,7 +84,16 @@ export const SeedVideo = t.Object({ }), }), t.Object({ - externalId: ExternalIds, + externalId: t.Record( + t.String(), + t.Omit( + t.Union([ + EpisodeId.patternProperties[PatternStringExact], + ExternalId().patternProperties[PatternStringExact], + ]), + ["link"], + ), + ), }), t.Object({ movie: t.Union([