From c7a7d7ec2c4fdc9af76945403db9eee9baa21442 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 7 Oct 2026 02:05:14 +0800 Subject: [PATCH] =?UTF-8?q?copy(server):=20=E5=88=AE=E5=89=8A=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E4=B8=8E=E7=99=BB=E5=BD=95=E6=8F=90=E7=A4=BA=E8=A1=A5?= =?UTF-8?q?=E6=94=B9;=E5=90=8C=E6=AD=A5=E6=95=B0=E6=8D=AE=E6=B8=85?= =?UTF-8?q?=E7=90=86=E3=80=81=E6=95=B4=E7=90=86=E5=AE=88=E5=8D=AB=E7=AD=89?= =?UTF-8?q?=E6=96=AD=E8=A8=80?= 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 --- .../src/modules/acquisition-organize/services/takeover.ts | 2 +- .../src/modules/sources-identity/service/account.ts | 2 +- .../test/acquisition-organize/organize-guard.test.ts | 2 +- .../test/file-manager/copy-dir-and-overrides.test.ts | 2 +- apps/server/test/file-manager/organize-overrides.test.ts | 4 ++-- apps/server/test/system/db-retention.test.ts | 8 ++++---- apps/server/test/system/storage.test.ts | 2 +- packages/contracts/src/reasons.ts | 6 +++--- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/server/src/modules/acquisition-organize/services/takeover.ts b/apps/server/src/modules/acquisition-organize/services/takeover.ts index 43b222d7..b8ce673c 100644 --- a/apps/server/src/modules/acquisition-organize/services/takeover.ts +++ b/apps/server/src/modules/acquisition-organize/services/takeover.ts @@ -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 }; }, }; diff --git a/apps/server/src/modules/sources-identity/service/account.ts b/apps/server/src/modules/sources-identity/service/account.ts index e8ae61fc..a2ff4ad7 100644 --- a/apps/server/src/modules/sources-identity/service/account.ts +++ b/apps/server/src/modules/sources-identity/service/account.ts @@ -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); diff --git a/apps/server/test/acquisition-organize/organize-guard.test.ts b/apps/server/test/acquisition-organize/organize-guard.test.ts index 10c44f48..d89507c1 100644 --- a/apps/server/test/acquisition-organize/organize-guard.test.ts +++ b/apps/server/test/acquisition-organize/organize-guard.test.ts @@ -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); diff --git a/apps/server/test/file-manager/copy-dir-and-overrides.test.ts b/apps/server/test/file-manager/copy-dir-and-overrides.test.ts index 9ded14e2..18562b33 100644 --- a/apps/server/test/file-manager/copy-dir-and-overrides.test.ts +++ b/apps/server/test/file-manager/copy-dir-and-overrides.test.ts @@ -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")); diff --git a/apps/server/test/file-manager/organize-overrides.test.ts b/apps/server/test/file-manager/organize-overrides.test.ts index f9dea4ca..b351a00b 100644 --- a/apps/server/test/file-manager/organize-overrides.test.ts +++ b/apps/server/test/file-manager/organize-overrides.test.ts @@ -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(/电影不用指定季集/)]); }); }); diff --git a/apps/server/test/system/db-retention.test.ts b/apps/server/test/system/db-retention.test.ts index 4784c720..8c0a3517 100644 --- a/apps/server/test/system/db-retention.test.ts +++ b/apps/server/test/system/db-retention.test.ts @@ -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)", () => { diff --git a/apps/server/test/system/storage.test.ts b/apps/server/test/system/storage.test.ts index b3ac8070..f19eb033 100644 --- a/apps/server/test/system/storage.test.ts +++ b/apps/server/test/system/storage.test.ts @@ -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([ diff --git a/packages/contracts/src/reasons.ts b/packages/contracts/src/reasons.ts index 20b89755..4bee21e0 100644 --- a/packages/contracts/src/reasons.ts +++ b/packages/contracts/src/reasons.ts @@ -102,7 +102,7 @@ const REASONS: Record = { // SCR-1 / SCR-2 刮削(刮削记录、逐文件结果) scrape_no_files: { text: "作品没有已整理文件", action: "到文件管理里对目录刮削" }, scrape_no_metadata: { text: "没有可用的元数据", action: "指定 TMDB 条目后重新刮削" }, - scrape_root_read_only: { text: "只登记模式的媒体库目录,不写文件" }, + scrape_root_read_only: { text: "媒体库目录是只登记模式,不写文件" }, scrape_root_offline: { text: "目录不可访问或未挂载" }, scrape_not_video: { text: "不是视频文件或目录" }, scrape_path_missing: { text: "目录或文件已不存在" }, @@ -110,9 +110,9 @@ const REASONS: Record = { task_enqueue_failed: { text: "后台任务没排上", action: "稍后重试" }, scrape_no_videos: { text: "目录里没有视频", action: "对作品或季目录刮削" }, scrape_tmdb_unavailable: { text: "TMDB 不可用", action: "检查 TMDB 设置后重新刮削" }, - scrape_exists: { text: "文件已存在,不是本工具写的或只补缺失时不改" }, + scrape_exists: { text: "已有文件,没有覆盖(不是本工具写的,或选了只补缺失)" }, scrape_unchanged: { text: "内容没有变化" }, - scrape_user_modified: { text: "文件写入后被改过,更新时不覆盖", action: "要替换就选全部覆盖重新刮削" }, + scrape_user_modified: { text: "文件写入后被改过,更新时不覆盖", action: "要替换就用「全部覆盖」重新刮削" }, scrape_metadata_missing: { text: "缺少这一季或这一集的元数据,没有写占位文件", action: "刷新元数据后重新刮削" }, scrape_internal_error: { text: "刮削过程中出错", action: "查看日志后重新刮削" }, scrape_write_failed: { text: "写入目录失败", action: "检查目录权限后重新刮削" },