feat(web): 文件管理「刮削…」对任意目录可用,候选选择与刮削结果(SCR-2)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
87bf33b42b
commit
d8ae5e179c
8 files changed
+426
-126
No files matched your search
@@ -98,8 +98,11 @@ 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 "writeNfo":
|
||||
if (root.kind === "library" && !root.writable) return "只读目录,不写 NFO";
|
||||
if (e.status === "temp") return "未完成的文件不能刮削";
|
||||
return null;
|
||||
case "probe":
|
||||
return e.type === "file" && e.fileKind === "video" ? null : "只能探测视频文件";
|
||||
case "copy":
|
||||
@@ -355,8 +358,10 @@ export function opApplies(op: MenuKey, e: FileEntry): boolean {
|
||||
return !e.asset && (isVideo(e) || e.type === "dir") && e.status !== "temp";
|
||||
case "identify":
|
||||
return isVideo(e) || e.type === "dir";
|
||||
case "scrape":
|
||||
case "writeNfo":
|
||||
// SCR-2:照 MP,任意视频文件或目录都能刮削(不要求已登记)
|
||||
return isVideo(e) || e.type === "dir";
|
||||
case "scrape":
|
||||
case "openMedia":
|
||||
return !!e.asset;
|
||||
case "records":
|
||||
@@ -417,10 +422,8 @@ 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);
|
||||
add("writeNfo", null);
|
||||
}
|
||||
if (list.every((x) => !!x.asset)) add("scrape", null);
|
||||
if (all("writeNfo")) add("writeNfo", why("writeNfo"));
|
||||
sep();
|
||||
add("delete", why("delete"));
|
||||
return out;
|
||||
@@ -441,7 +444,7 @@ export const OP_LABEL: Record<MenuKey, string> = {
|
||||
move: "移动到…",
|
||||
copy: "复制到…",
|
||||
scrape: "刷新元数据",
|
||||
writeNfo: "刮削",
|
||||
writeNfo: "刮削…",
|
||||
probe: "探测",
|
||||
copyPath: "复制路径…",
|
||||
openMedia: "打开作品",
|
||||
|
||||
Reference in new issue
Block a user