fix(organize): 按真实文件样本验证并保存季集映射

This commit is contained in:
root committed 2026-10-13 15:52:51 +08:00
1 parent d196235418
commit 679389f854
5 files changed
+577 -30

No files matched your search

+18 -2
View File
@@ -980,6 +980,17 @@ export const EpisodeInspectRelease = z.object({
evidence: z.array(z.string()),
});
export type EpisodeInspectRelease = z.infer<typeof EpisodeInspectRelease>;
export const EpisodeInspectFile = z.object({
organizationRecordId: Id,
sourcePath: z.string(),
title: z.string(),
publishedAt: z.string().nullable(),
releaseGroup: z.string().nullable(),
source: EpisodeSourceView,
current: EpisodeResultBrief,
evidence: z.array(z.string()),
});
export type EpisodeInspectFile = z.infer<typeof EpisodeInspectFile>;
export const EpisodeMappingInspectOutput = z.object({
entity: z.object({ id: Id, title: z.string(), kind: MediaKind, year: z.number().int().nullable() }),
scope: z.object({ season: z.number().int().nullable(), releaseGroup: z.string().nullable() }),
@@ -993,6 +1004,8 @@ export const EpisodeMappingInspectOutput = z.object({
.nullable(),
/** 事项内资源(没有事项时 = 这个范围里当前待确认的资源),最多 50 条 */
releases: z.array(EpisodeInspectRelease),
/** 整理中无法换算的真实文件编号,最多 50 条;发布时间无来源证据时为 null */
files: z.array(EpisodeInspectFile),
/** 同作品同发布组近期的其他资源(含已对上 / 已换算的),最多 50 条 */
neighbors: z.array(EpisodeInspectRelease),
/** 季表:每季总集数、已知每集播出日期与标题(每季最多 100 集) */
@@ -1021,7 +1034,7 @@ export const EpisodeMappingInspectOutput = z.object({
}),
/** 确定性建议(按发布时间对播出日期,全部样本成立且唯一才有) */
suggestion: EpisodeSuggestion.nullable(),
truncated: z.object({ releases: z.boolean(), neighbors: z.boolean() }),
truncated: z.object({ releases: z.boolean(), neighbors: z.boolean(), files: z.boolean().optional() }),
});
export const EpisodeMappingSimulateInput = z.object({
@@ -1035,7 +1048,10 @@ export const EpisodeMappingSimulateInput = z.object({
reasons: z.array(z.string().trim().min(1).max(300)).max(10).optional(),
});
export const EpisodeSimulationItem = z.object({
sourceReleaseId: Id,
/** 文件样本没有资源 ID */
sourceReleaseId: Id.nullable(),
organizationRecordId: Id.optional(),
sourcePath: z.string().optional(),
title: z.string(),
releaseGroup: z.string().nullable(),
/** 是否是事项内样本 */