copy(server): 刮削原因与登录提示补改;同步数据清理、整理守卫等断言
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
1 parent
0019dc1afe
commit
c7a7d7ec2c
8 files changed
+14
-14
No files matched your search
@@ -355,7 +355,7 @@ export function organizeDecisionHook(d: AoDeps): DecisionHook {
|
||||
`decision-${key}`,
|
||||
);
|
||||
if (r.status !== "running" && r.status !== "queued")
|
||||
throw new HookError("conflict", `重新整理仍未能执行:${r.reason ?? r.status}`);
|
||||
throw new HookError("conflict", `重新整理没能执行:${r.reason ?? r.status}`);
|
||||
return { kind: "organize", choice: key, ...r };
|
||||
},
|
||||
};
|
||||
|
||||
@@ -494,7 +494,7 @@ export async function refreshSiteAccount(
|
||||
if (r.kind === "ok") return await succeed(r.info);
|
||||
return await succeed(
|
||||
null,
|
||||
`登录成功;用户数据未取到:${r.kind === "no_parser" ? "站点没有用户数据解析器" : r.message}`,
|
||||
`登录成功,但没取到用户数据:${r.kind === "no_parser" ? "站点没有用户数据解析器" : r.message}`,
|
||||
);
|
||||
}
|
||||
const plain = await secrets.resolve(acc.secret_ref);
|
||||
|
||||
@@ -240,7 +240,7 @@ describe.skipIf(!hasPg)("手动整理守卫:路径 / Move 授权 / 做种义务"
|
||||
// 按下载任务 ID(管理员也一样被做种义务拦下)
|
||||
const byId = await post({ downloadTaskId: dtId, action: "move" });
|
||||
expect(byId.status).toBe(409);
|
||||
expect(byId.body.error.message).toContain("未改为复制");
|
||||
expect(byId.body.error.message).toContain("没有改成复制");
|
||||
// 按路径命中纳管任务的内容
|
||||
const content = join(cache.root, "Seeding.2023.1080p.BluRay-HR.mkv");
|
||||
expect(existsSync(content)).toBe(true);
|
||||
|
||||
@@ -245,7 +245,7 @@ describe.skipIf(skip)("files W5-A2", () => {
|
||||
expect(tvTargets.some((t: string | null) => t?.endsWith("Season 2/剧 - S02E03-E04 - 第 3-4 集.mkv"))).toBe(true);
|
||||
expect(tvTargets.some((t: string | null) => t?.endsWith("Season 2/剧 - S02E05-E06 - 第 5-6 集.mkv"))).toBe(true);
|
||||
expect(tv.warnings).toEqual([]);
|
||||
expect(mv.warnings).toEqual([expect.stringMatching(/电影不适用季\/集覆写/)]);
|
||||
expect(mv.warnings).toEqual([expect.stringMatching(/电影不用指定季集/)]);
|
||||
expect(mv).toMatchObject({ action: "copy", slotId: slot.id, targetDir: join(h.lib, "picked") });
|
||||
expect(mv.files[0].target).toBe(join(h.lib, "picked", "Film (2019) - 1080p.mkv"));
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ describe.skipIf(skip)("files 整理人工集号校验", () => {
|
||||
items: [{ root: h.dlRoot, path: "Season", ...entity, season: 1, episodes: [2] }],
|
||||
});
|
||||
expect(r.status).toBe(400);
|
||||
expect(r.body.error.message).toContain("目录项不能指定集号");
|
||||
expect(r.body.error.message).toContain("目录不能指定集号");
|
||||
expect(await facts()).toEqual(before);
|
||||
});
|
||||
|
||||
@@ -116,6 +116,6 @@ describe.skipIf(skip)("files 整理人工集号校验", () => {
|
||||
items: [{ root: h.dlRoot, path, mediaEntityId: film, season: 1, episodes: [2, 4] }],
|
||||
});
|
||||
expect(r.status).toBe(200);
|
||||
expect(r.body.data.groups[0].warnings).toEqual([expect.stringMatching(/电影不适用季\/集覆写/)]);
|
||||
expect(r.body.data.groups[0].warnings).toEqual([expect.stringMatching(/电影不用指定季集/)]);
|
||||
});
|
||||
});
|
||||
@@ -189,11 +189,11 @@ describe.skipIf(!hasPg)("数据库清理(真实 PG)", () => {
|
||||
expect(Object.fromEntries(preview.map((p) => [p.label, p.rows]))).toEqual({
|
||||
已投递事件: 3,
|
||||
识别尝试: 2,
|
||||
已识别的待识别条目: 1,
|
||||
站点快照: 3,
|
||||
已识别的未识别资源: 1,
|
||||
站点抓取记录: 3,
|
||||
});
|
||||
// 站点快照 3 行、batchSize 2:分两批
|
||||
expect(await run("pipeline")).toBe("已投递事件 3、识别尝试 2、已识别的待识别条目 1、站点快照 3 行已删除");
|
||||
expect(await run("pipeline")).toBe("已投递事件 3、识别尝试 2、已识别的未识别资源 1、站点抓取记录 3 行已删除");
|
||||
|
||||
const types = await sql<{ id: string }>`select type as id from outbox_event`.execute(h.db);
|
||||
expect(types.rows.map((r) => r.id).sort()).toEqual(
|
||||
@@ -225,7 +225,7 @@ describe.skipIf(!hasPg)("数据库清理(真实 PG)", () => {
|
||||
h.db,
|
||||
);
|
||||
const counts = await countRules(h.db, job("pipeline").rules!(ctx()));
|
||||
expect(counts.find((p) => p.label === "站点快照")?.rows).toBe(1);
|
||||
expect(counts.find((p) => p.label === "站点抓取记录")?.rows).toBe(1);
|
||||
});
|
||||
|
||||
it("定时任务登记:流水数据清理每天低峰一次(cron)", () => {
|
||||
|
||||
@@ -251,7 +251,7 @@ describe.skipIf(!hasPg)("CACHE-2 存储(真实 PG)", () => {
|
||||
await cand("r1", "unmatched", 31);
|
||||
await cand("r2", "unmatched", 29);
|
||||
await cand("r3", "ambiguous", 31);
|
||||
expect(await job("identity_pool")(now)).toBe("归档 1 条未识别条目");
|
||||
expect(await job("identity_pool")(now)).toBe("归档 1 条未识别资源");
|
||||
const st = await sql<{ t: string; s: string }>`select sr.title as t, c.status as s from identity_candidate c
|
||||
join source_release sr on sr.id = c.source_release_id order by sr.title`.execute(h.db);
|
||||
expect(st.rows).toEqual([
|
||||
|
||||
Reference in new issue
Block a user