feat(web): 刮削设置分区、作品详情刮削状态与文件管理「刮削」(SCR-1)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
f38eca419e
commit
df033130f5
10 files changed
+313
-23
No files matched your search
@@ -64,6 +64,7 @@ export type FileOp =
|
||||
| "organize"
|
||||
| "identify"
|
||||
| "scrape"
|
||||
| "writeNfo"
|
||||
| "probe"
|
||||
| "delete"
|
||||
| "copyPath"
|
||||
@@ -97,6 +98,7 @@ export function opDisabledReason(op: FileOp, e: FileEntry, root: Pick<FileRoot,
|
||||
if (e.type === "file" && e.fileKind !== "video") return "只有视频或目录能整理";
|
||||
return null;
|
||||
case "scrape":
|
||||
case "writeNfo":
|
||||
return e.asset ? null : "未登记,先整理入库";
|
||||
case "probe":
|
||||
return e.type === "file" && e.fileKind === "video" ? null : "只能探测视频文件";
|
||||
@@ -334,6 +336,7 @@ export type MenuKey =
|
||||
| "move"
|
||||
| "copy"
|
||||
| "scrape"
|
||||
| "writeNfo"
|
||||
| "probe"
|
||||
| "copyPath"
|
||||
| "openMedia"
|
||||
@@ -353,6 +356,7 @@ export function opApplies(op: MenuKey, e: FileEntry): boolean {
|
||||
case "identify":
|
||||
return isVideo(e) || e.type === "dir";
|
||||
case "scrape":
|
||||
case "writeNfo":
|
||||
case "openMedia":
|
||||
return !!e.asset;
|
||||
case "records":
|
||||
@@ -366,8 +370,8 @@ export function opApplies(op: MenuKey, e: FileEntry): boolean {
|
||||
|
||||
/**
|
||||
* 单项 / 多选菜单的项与顺序(规格 §5.2):
|
||||
* 单项:打开 ─ 整理 识别 重命名 移动 复制 ─ 刷新元数据 探测 ─ 复制路径 打开作品 查看整理记录 ─ 删除
|
||||
* 多选:整理 n 项 识别 移动 复制 探测 刷新元数据 ─ 删除 n 项
|
||||
* 单项:打开 ─ 整理 识别 重命名 移动 复制 ─ 刷新元数据 刮削 探测 ─ 复制路径 打开作品 查看整理记录 ─ 删除
|
||||
* 多选:整理 n 项 识别 移动 复制 探测 刷新元数据 刮削 ─ 删除 n 项
|
||||
*/
|
||||
export function menuModel(list: FileEntry[], root: Pick<FileRoot, "kind" | "writable">): MenuModelItem[] {
|
||||
const multi = list.length > 1;
|
||||
@@ -391,6 +395,7 @@ export function menuModel(list: FileEntry[], root: Pick<FileRoot, "kind" | "writ
|
||||
add("copy", e.escape ? "链接指向登记目录之外" : null);
|
||||
sep();
|
||||
if (opApplies("scrape", e)) add("scrape", why("scrape"));
|
||||
if (opApplies("writeNfo", e)) add("writeNfo", why("writeNfo"));
|
||||
if (opApplies("probe", e)) add("probe", null);
|
||||
sep();
|
||||
add("copyPath", null);
|
||||
@@ -412,7 +417,10 @@ export function menuModel(list: FileEntry[], root: Pick<FileRoot, "kind" | "writ
|
||||
add("move", why("move"));
|
||||
add("copy", list.some((x) => x.escape) ? "含指向登记目录之外的链接" : null);
|
||||
if (any("probe")) add("probe", null);
|
||||
if (list.every((x) => !!x.asset)) add("scrape", null);
|
||||
if (list.every((x) => !!x.asset)) {
|
||||
add("scrape", null);
|
||||
add("writeNfo", null);
|
||||
}
|
||||
sep();
|
||||
add("delete", why("delete"));
|
||||
return out;
|
||||
@@ -433,6 +441,7 @@ export const OP_LABEL: Record<MenuKey, string> = {
|
||||
move: "移动到…",
|
||||
copy: "复制到…",
|
||||
scrape: "刷新元数据",
|
||||
writeNfo: "刮削",
|
||||
probe: "探测",
|
||||
copyPath: "复制路径…",
|
||||
openMedia: "打开作品",
|
||||
|
||||
Reference in new issue
Block a user