From 45f904298e34fec2b02efb2d38e6f4c3cc7b4200 Mon Sep 17 00:00:00 2001 From: Arlind-dev Date: Fri, 22 May 2026 00:56:01 +0200 Subject: [PATCH] fix: handle object form of themoviedb_id from Fribb data --- src/update.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/update.ts b/src/update.ts index 19d751f93..ad333966b 100644 --- a/src/update.ts +++ b/src/update.ts @@ -25,7 +25,7 @@ export type AnimeListsSchema = Array<{ animenewsnetwork_id?: number animecountdown_id?: number simkl_id?: number - themoviedb_id?: number | "unknown" + themoviedb_id?: number | "unknown" | { tv?: number; movie?: number } tvdb_id?: number season?: { tvdb?: number @@ -104,7 +104,11 @@ export const formatEntry = (entry: AnimeListsSchema[number]): Relation => ({ media: handleBadValues(entry.type), myanimelist: handleBadValues(entry.mal_id), simkl: handleBadValues(entry.simkl_id), - themoviedb: handleBadValues(entry.themoviedb_id), + themoviedb: handleBadValues( + typeof entry.themoviedb_id === "object" && entry.themoviedb_id !== null + ? (entry.themoviedb_id.tv ?? entry.themoviedb_id.movie) + : entry.themoviedb_id, + ), "themoviedb-season": handleBadValues(entry.season?.tmdb), thetvdb: handleBadValues(entry.tvdb_id), "thetvdb-season": handleBadValues(entry.season?.tvdb),