fix(identify): rank TMDB candidates by original title too

catalog.lookup only returned the zh-CN localized title, so an English
release name (Dune.Part.Two.2024...) was rejected against "沙丘2" and
files/identify came back with zero candidates. Pass originalTitle
through catalog.lookup and use it as an extra title in ranking.

Found in REAL-1b on the v0.2.2 test stack; needs an image rebuild to
take effect.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-29 00:33:20 +08:00
1 parent 1de131b192
commit 775344f597
3 files changed
+7 -1

No files matched your search

@@ -318,6 +318,7 @@ async function identifyCore(
entityType: string;
externalId: string;
title: string;
originalTitle?: string | null;
year: number | null;
posterPath?: string | null;
}[];
@@ -329,7 +330,8 @@ async function identifyCore(
provider: m.provider,
entityType: m.entityType as "movie" | "tv",
externalId: m.externalId,
titles: [m.title],
// 本地化标题(zh-CN)配不上英文文件名,原名也作标题参与排序
titles: m.originalTitle && m.originalTitle !== m.title ? [m.title, m.originalTitle] : [m.title],
...(m.year !== null ? { year: m.year } : {}),
aliases: [],
}));
@@ -53,6 +53,7 @@ export function registerSourcesCapabilities(registry: CapabilityRegistry, rt: ()
entityType: ExternalEntityType;
externalId: string;
title: string;
originalTitle?: string | null;
year: number | null;
posterPath?: string | null;
}[] = [];
@@ -66,6 +67,7 @@ export function registerSourcesCapabilities(registry: CapabilityRegistry, rt: ()
entityType: m.entityType,
externalId: m.externalId,
title: m.title,
originalTitle: m.originalTitle,
year: m.year,
posterPath: m.posterPath,
});
@@ -52,6 +52,8 @@ export const CatalogLookupOutput = z.object({
entityType: ExternalEntityType,
externalId: z.string(),
title: z.string(),
/** 原名(TMDB original_title/name);与本地化标题不同语种时识别要靠它匹配英文文件名 */
originalTitle: z.string().nullable().optional(),
year: z.number().int().nullable(),
/** TMDB poster_path;文件管理识别候选拼海报缩略图 */
posterPath: z.string().nullable().optional(),