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:
1 parent
1de131b192
commit
775344f597
3 files changed
+7
-1
No files matched your search
@@ -318,6 +318,7 @@ async function identifyCore(
|
|||||||
entityType: string;
|
entityType: string;
|
||||||
externalId: string;
|
externalId: string;
|
||||||
title: string;
|
title: string;
|
||||||
|
originalTitle?: string | null;
|
||||||
year: number | null;
|
year: number | null;
|
||||||
posterPath?: string | null;
|
posterPath?: string | null;
|
||||||
}[];
|
}[];
|
||||||
@@ -329,7 +330,8 @@ async function identifyCore(
|
|||||||
provider: m.provider,
|
provider: m.provider,
|
||||||
entityType: m.entityType as "movie" | "tv",
|
entityType: m.entityType as "movie" | "tv",
|
||||||
externalId: m.externalId,
|
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 } : {}),
|
...(m.year !== null ? { year: m.year } : {}),
|
||||||
aliases: [],
|
aliases: [],
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ export function registerSourcesCapabilities(registry: CapabilityRegistry, rt: ()
|
|||||||
entityType: ExternalEntityType;
|
entityType: ExternalEntityType;
|
||||||
externalId: string;
|
externalId: string;
|
||||||
title: string;
|
title: string;
|
||||||
|
originalTitle?: string | null;
|
||||||
year: number | null;
|
year: number | null;
|
||||||
posterPath?: string | null;
|
posterPath?: string | null;
|
||||||
}[] = [];
|
}[] = [];
|
||||||
@@ -66,6 +67,7 @@ export function registerSourcesCapabilities(registry: CapabilityRegistry, rt: ()
|
|||||||
entityType: m.entityType,
|
entityType: m.entityType,
|
||||||
externalId: m.externalId,
|
externalId: m.externalId,
|
||||||
title: m.title,
|
title: m.title,
|
||||||
|
originalTitle: m.originalTitle,
|
||||||
year: m.year,
|
year: m.year,
|
||||||
posterPath: m.posterPath,
|
posterPath: m.posterPath,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ export const CatalogLookupOutput = z.object({
|
|||||||
entityType: ExternalEntityType,
|
entityType: ExternalEntityType,
|
||||||
externalId: z.string(),
|
externalId: z.string(),
|
||||||
title: z.string(),
|
title: z.string(),
|
||||||
|
/** 原名(TMDB original_title/name);与本地化标题不同语种时识别要靠它匹配英文文件名 */
|
||||||
|
originalTitle: z.string().nullable().optional(),
|
||||||
year: z.number().int().nullable(),
|
year: z.number().int().nullable(),
|
||||||
/** TMDB poster_path;文件管理识别候选拼海报缩略图 */
|
/** TMDB poster_path;文件管理识别候选拼海报缩略图 */
|
||||||
posterPath: z.string().nullable().optional(),
|
posterPath: z.string().nullable().optional(),
|
||||||
|
|||||||
Reference in new issue
Block a user