From 074dab04cafdb3a1965d27aa77f9e6fa8b62dd4e Mon Sep 17 00:00:00 2001 From: root Date: Sat, 3 Oct 2026 23:31:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(identity):=20=E5=AD=A3=E8=A1=A8=E5=8F=AA?= =?UTF-8?q?=E8=AE=A1=20TMDB=20/=20=E4=BA=BA=E5=B7=A5=E6=9D=A5=E6=BA=90?= =?UTF-8?q?=E6=88=96=E5=B7=B2=E7=A1=AE=E8=AE=A4=E7=9A=84=E5=AD=A3,?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=87=92=E5=BB=BA=E7=9A=84=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=E5=AD=A3=E4=B8=8D=E7=AE=97(M2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei --- .../sources-identity/service/episode-resolution.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/server/src/modules/sources-identity/service/episode-resolution.ts b/apps/server/src/modules/sources-identity/service/episode-resolution.ts index 0b346edd..670fcfbd 100644 --- a/apps/server/src/modules/sources-identity/service/episode-resolution.ts +++ b/apps/server/src/modules/sources-identity/service/episode-resolution.ts @@ -38,7 +38,11 @@ const ENDED_STATUSES = new Set(["ended", "canceled", "cancelled"]); /** 待处理证据里最多列多少条资源 */ const DECISION_LIST_LIMIT = 50; -/** 作品季表:季号 ≥ 0 的季单元;最新季 = 季号 ≥ 1 的最大季单元 */ +/** + * 作品季表:季号 ≥ 0 的季单元;最新季 = 季号 ≥ 1 的最大季单元。 + * 只计元数据(tmdb)/ 人工(user)来源或已确认的季单元:资源 / 文件懒建的临时季(解析错的 S05 之类)不进季表, + * 否则它总集数为空会让该季资源一律按「元数据滞后」放行,还会抬高最新季。 + */ export async function loadSeasonTable(exec: Exec, entityId: string): Promise { const entity = await exec .selectFrom("media_entity") @@ -52,6 +56,8 @@ export async function loadSeasonTable(exec: Exec, entityId: string): Promise`to_char(air_date, 'YYYY-MM-DD')`.as("air"), ]) .where("media_entity_id", "=", entityId) @@ -63,6 +69,7 @@ export async function loadSeasonTable(exec: Exec, entityId: string): Promise(); for (const u of units) { if (u.kind !== "season" || u.season_number === null || u.season_number < 0) continue; + if (u.status !== "confirmed" && u.source !== "tmdb" && u.source !== "user") continue; const cur = seasons.get(u.season_number); // 重复季单元(并发懒建遗留)取已知的较大总集数 const total = u.episode_total ?? null;