fix(identity): include episode and recognition words in resolve idempotency
This commit is contained in:
1 parent
864856c9bb
commit
27386ba9df
3 files changed
+39
-4
No files matched your search
@@ -307,7 +307,7 @@ describe.skipIf(!pg)("识别词接口", () => {
|
||||
const g = (await call("/identify-words/global")).body.data;
|
||||
const saved = await call("/identify-words/global", {
|
||||
method: "PUT",
|
||||
body: { text: `${g.text}Kusuriya no Hitorigoto - 4 <> \\[Baha >> EP-28\n`, expectedVersion: g.version },
|
||||
body: { text: `${g.text}Kusuriya no Hitorigoto - (?=4\\d) <> \\[Baha >> EP-28\n`, expectedVersion: g.version },
|
||||
});
|
||||
const version = saved.body.data.block.version as number;
|
||||
const before = h.engine.enqueued.length;
|
||||
@@ -321,15 +321,19 @@ describe.skipIf(!pg)("识别词接口", () => {
|
||||
expect(p.scanned).toBeGreaterThanOrEqual(4);
|
||||
|
||||
// 重新识别后集数按全局识别词偏移(40 → 12,对上第 1 季),命中的行记在解析结果上
|
||||
await resolveRelease(h.rt, { sourceReleaseId: lilith40, force: true, trigger: "review" });
|
||||
const resolved = await resolveRelease(h.rt, { sourceReleaseId: lilith40, force: true, trigger: "review" });
|
||||
expect(resolved.outcome).toBe("auto");
|
||||
const row = await h.db
|
||||
.selectFrom("source_release")
|
||||
.select(["parsed"])
|
||||
.where("id", "=", lilith40)
|
||||
.executeTakeFirstOrThrow();
|
||||
expect((row.parsed as { words?: { applied: string[] } }).words?.applied).toEqual([
|
||||
"Kusuriya no Hitorigoto - 4 <> \\[Baha >> EP-28",
|
||||
"Kusuriya no Hitorigoto - (?=4\\d) <> \\[Baha >> EP-28",
|
||||
]);
|
||||
expect(await er(lilith40)).toMatchObject({ source: { season: 1, episodes: { start: 12, end: 12 } } });
|
||||
const unchanged = await resolveRelease(h.rt, { sourceReleaseId: lilith40, force: true, trigger: "review" });
|
||||
expect(unchanged).toMatchObject({ outcome: "skipped", reason: "unchanged" });
|
||||
});
|
||||
|
||||
it("全局示例:没给标题时从近期资源里找命中的", async () => {
|
||||
|
||||
Reference in new issue
Block a user