fix(identity): include episode and recognition words in resolve idempotency

This commit is contained in:
root committed 2026-10-13 20:56:37 +08:00
1 parent 864856c9bb
commit 27386ba9df
3 files changed
+39 -4

No files matched your search

@@ -0,0 +1,19 @@
import { type ParsedRelease, parseRelease } from "@umt/domain";
import { expect, it } from "vitest";
import { evidenceVersion } from "../../src/modules/sources-identity/service/resolve.ts";
it("身份候选不变时,季集和规则匹配输入变化也必须重算;相同事实仍幂等", () => {
const original = parseRelease("[Lilith-Raws] Example S01E40 [1080p]");
const before = evidenceVersion(original, []);
const changes: Partial<ParsedRelease>[] = [
{ season: 2 },
{ seasonEnd: 2 },
{ seasonInferred: true },
{ episodes: { start: 12, end: 12 } },
{ airDate: "20250314" },
{ releaseGroup: { name: "ANi", source: "bracket" } },
{ words: { applied: ["Example >> EP-28"], original: original.raw } },
];
for (const change of changes) expect(evidenceVersion({ ...original, ...change }, [])).not.toBe(before);
expect(evidenceVersion(structuredClone(original), [])).toBe(before);
});