feat(copy): 处理状态的「入库」改为「整理」,术语表与 check:copy 同步
真正入库取决于媒体服务器有没有扫到,本工具只负责整理(元数据、NFO 与图片、按规则归到目录)。 界面与面向用户的服务端文案里「已入库 / 未入库 / 部分入库 / 入库失败 / 入库中 / 入库后 / 原地入库…」 改为「已整理 / 未整理 / 部分整理 / 整理失败 / 整理中 / 整理后 / 原地整理…」;文件管理快速筛选「已整理」、 目录副行「n 个已整理 / 未整理」、季卡片「已整理 x/y」。代码标识符不改,「Emby 已有」这类媒体服务器状态保留。 glossary 加「整理」口径条目;check:copy 拦处理状态语境的「入库」搭配,其它线待替换的文件暂列 TERM_PENDING。 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
1 parent
79c3b8c9b9
commit
550ac285f4
67 files changed
+171
-143
No files matched your search
@@ -25,12 +25,12 @@ describe("下载面板展示换算(DL-2)", () => {
|
||||
expect(formatEta(3 * 86400 + 4 * 3600)).toBe("3 天 4 小时");
|
||||
});
|
||||
|
||||
it("最近一次整理结果:已入库 / 整理中 / 待整理 / 入库失败 / 部分入库;有问题的链到整理记录就地处理", () => {
|
||||
it("最近一次整理结果:已整理 / 整理中 / 待整理 / 整理失败 / 部分整理;有问题的链到整理记录就地处理", () => {
|
||||
expect(organizeState({ status: "completed", organize: null })).toMatchObject({ label: "待整理", to: null });
|
||||
expect(organizeState({ status: "importing", organize: null })?.label).toBe("整理中");
|
||||
expect(organizeState({ status: "imported", organize: null })?.label).toBe("已入库");
|
||||
expect(organizeState({ status: "imported", organize: null })?.label).toBe("已整理");
|
||||
expect(organizeState({ status: "completed", organize: rec("succeeded") })).toMatchObject({
|
||||
label: "已入库",
|
||||
label: "已整理",
|
||||
tone: "success",
|
||||
to: `/console/organize/${RID}`,
|
||||
});
|
||||
@@ -44,7 +44,7 @@ describe("下载面板展示换算(DL-2)", () => {
|
||||
});
|
||||
// 原因码转成人话,不直接给人看
|
||||
expect(failed).toMatchObject({
|
||||
label: "入库失败",
|
||||
label: "整理失败",
|
||||
tone: "destructive",
|
||||
hint: "没识别出作品。指定作品后重新整理",
|
||||
});
|
||||
@@ -52,7 +52,7 @@ describe("下载面板展示换算(DL-2)", () => {
|
||||
expect(organizeState({ status: "completed", organize: rec("failed", { reason: "磁盘已满" }) })?.hint).toBe(
|
||||
"磁盘已满",
|
||||
);
|
||||
expect(organizeState({ status: "completed", organize: rec("partial") })?.label).toBe("部分入库");
|
||||
expect(organizeState({ status: "completed", organize: rec("partial") })?.label).toBe("部分整理");
|
||||
expect(organizeState({ status: "completed", organize: rec("failed", { reason: "transfer_failed" }) })?.hint).toBe(
|
||||
"文件没有整理成功。在整理记录里查看失败的文件",
|
||||
);
|
||||
@@ -72,11 +72,11 @@ describe("下载面板展示换算(DL-2)", () => {
|
||||
it("外部任务:没整理过显示 —(null),整理过的照常显示结果", () => {
|
||||
expect(organizeState({ status: "completed", organize: null, managed: false })).toBeNull();
|
||||
expect(organizeState({ status: "completed", organize: null, managed: true })?.label).toBe("待整理");
|
||||
expect(organizeState({ status: "completed", organize: rec("succeeded"), managed: false })?.label).toBe("已入库");
|
||||
expect(organizeState({ status: "completed", organize: rec("succeeded"), managed: false })?.label).toBe("已整理");
|
||||
expect(
|
||||
organizeState({ status: "completed", organize: rec("failed", { reason: "transfer_failed" }), managed: false })
|
||||
?.label,
|
||||
).toBe("入库失败");
|
||||
).toBe("整理失败");
|
||||
});
|
||||
|
||||
it("连接数:全 0 且总数未知时不显示", () => {
|
||||
|
||||
@@ -40,7 +40,7 @@ export function reasonHint(raw: string | null | undefined): string | null {
|
||||
}
|
||||
|
||||
/**
|
||||
* 已完成任务的最近一次整理结果:已入库 / 整理中 / 待整理 / 入库失败 / 部分入库。
|
||||
* 已完成任务的最近一次整理结果:已整理 / 整理中 / 待整理 / 整理失败 / 部分整理。
|
||||
* 外部任务(managed=false)没整理过时不算"待整理",返回 null(界面显示 —);整理过的照常显示结果。
|
||||
*/
|
||||
export function organizeState(
|
||||
@@ -51,9 +51,9 @@ export function organizeState(
|
||||
// 有问题的整理在整理记录详情里就地处理(待处理中心已取消)
|
||||
const to = rec ? consolePath("organize", rec.recordId) : null;
|
||||
if (rec?.status === "succeeded" || (t.status === "imported" && rec?.status !== "failed"))
|
||||
return { label: "已入库", tone: "success", to, hint: null };
|
||||
if (rec?.status === "failed") return { label: "入库失败", tone: "destructive", to, hint: reasonHint(rec.reason) };
|
||||
if (rec?.status === "partial") return { label: "部分入库", tone: "warning", to, hint: reasonHint(rec.reason) };
|
||||
return { label: "已整理", tone: "success", to, hint: null };
|
||||
if (rec?.status === "failed") return { label: "整理失败", tone: "destructive", to, hint: reasonHint(rec.reason) };
|
||||
if (rec?.status === "partial") return { label: "部分整理", tone: "warning", to, hint: reasonHint(rec.reason) };
|
||||
if (rec?.status === "queued" || rec?.status === "running" || t.status === "importing")
|
||||
return { label: "整理中", tone: "neutral", to, hint: null };
|
||||
return { label: "待整理", tone: "warning", to: rec?.decision ? to : null, hint: null };
|
||||
|
||||
@@ -119,7 +119,7 @@ export function CacheVolumes() {
|
||||
</Button>
|
||||
}
|
||||
title="按规则清理下载缓存?"
|
||||
description="只清理已入库、且满足保留期与 H&R 的本工具任务,其余不动。"
|
||||
description="只清理已整理、且满足保留期与 H&R 的本工具任务,其余不动。"
|
||||
confirmLabel="清理"
|
||||
onConfirm={() =>
|
||||
cleanup.mutateAsync(undefined).then(
|
||||
|
||||
@@ -96,7 +96,7 @@ export function DownloadDetail({ task, live }: { task: DownloadTask; live?: Down
|
||||
const trace = useDownloadTrace(task, plan.data);
|
||||
const [organizing, setOrganizing] = useState(false);
|
||||
const canOrganize = ["completed", "importing", "imported"].includes(task.status);
|
||||
// 下载完成但最近一次整理失败:状态行只写"下载完成"会误导,单独说明入库失败
|
||||
// 下载完成但最近一次整理失败:状态行只写"下载完成"会误导,单独说明整理失败
|
||||
const lastRecord = [...(trace.records.data?.items ?? [])].sort((a, b) =>
|
||||
(b.startedAt ?? b.createdAt).localeCompare(a.startedAt ?? a.createdAt),
|
||||
)[0];
|
||||
@@ -143,7 +143,7 @@ export function DownloadDetail({ task, live }: { task: DownloadTask; live?: Down
|
||||
) : null}
|
||||
{importFailed ? (
|
||||
<p className="rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-caption text-destructive">
|
||||
入库失败:{reasonLine(importFailed.reason)}。
|
||||
整理失败:{reasonLine(importFailed.reason)}。
|
||||
<Link to={`/console/organize/${importFailed.id}`} className="ml-1 underline underline-offset-4">
|
||||
去整理记录处理
|
||||
</Link>
|
||||
|
||||
@@ -610,10 +610,10 @@ export function ExistingVersionsSection({
|
||||
<div className="flex min-w-0 flex-wrap items-center justify-between gap-2">
|
||||
<p className="min-w-0 text-caption text-foreground">{summary ?? `媒体库已有 ${versions.length} 个版本`}</p>
|
||||
<FilterSelect
|
||||
label="入库方式"
|
||||
label="已有版本"
|
||||
value={mode === "normal" ? "" : mode}
|
||||
onChange={(v) => onModeChange(v === "replace" ? "replace" : "normal")}
|
||||
allLabel="正常入库,保留已有版本"
|
||||
allLabel="保留"
|
||||
options={[{ value: "replace", label: "一次性洗版" }]}
|
||||
/>
|
||||
</div>
|
||||
@@ -640,7 +640,7 @@ export function ExistingVersionsSection({
|
||||
))}
|
||||
</fieldset>
|
||||
<p className="text-meta text-muted-foreground">
|
||||
本次新文件成功入库后替换所选旧文件。剧集只替换成功对应的季集,其余保留。
|
||||
本次新文件整理成功后替换所选旧文件。剧集只替换成功对应的季集,其余保留。
|
||||
</p>
|
||||
</>
|
||||
) : null}
|
||||
|
||||
Reference in new issue
Block a user