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;