Merge branch 'scr2'
Co-Authored-By: Claude Fable 5.1 <[email protected]> # Conflicts: # CHANGELOG.md # apps/server/src/modules/file-manager/routes.ts
This commit is contained in:
commit
44f7c88be6
41 files changed
+2810
-826
No files matched your search
@@ -61,6 +61,7 @@ import {
|
||||
MkdirDialog,
|
||||
RefreshMetadataDialog,
|
||||
RenameDialog,
|
||||
ScrapeDialog,
|
||||
TransferDialog,
|
||||
} from "~/components/files/dialogs.tsx";
|
||||
import { DirTree } from "~/components/files/dir-tree.tsx";
|
||||
@@ -109,7 +110,8 @@ type Dialog =
|
||||
| { kind: "delete"; items: FileRef[] }
|
||||
| { kind: "mkdir" }
|
||||
| { kind: "copyPath"; entry: FileEntry }
|
||||
| { kind: "refresh"; items: FileEntry[]; write?: boolean }
|
||||
| { kind: "refresh"; items: FileEntry[] }
|
||||
| { kind: "scrape"; items: FileEntry[] }
|
||||
| { kind: "wizard"; source: OrganizeSource }
|
||||
| { kind: "shortcuts" };
|
||||
|
||||
@@ -459,7 +461,7 @@ export default function FilesPage() {
|
||||
case "scrape":
|
||||
return setDialog({ kind: "refresh", items: list });
|
||||
case "writeNfo":
|
||||
return setDialog({ kind: "refresh", items: list, write: true });
|
||||
return setDialog({ kind: "scrape", items: list });
|
||||
case "probe":
|
||||
return doProbe(list);
|
||||
case "copyPath":
|
||||
@@ -709,9 +711,9 @@ export default function FilesPage() {
|
||||
});
|
||||
items.push({
|
||||
key: "writeNfo",
|
||||
label: "刮削",
|
||||
label: "刮削…",
|
||||
icon: FileDown,
|
||||
disabled: selected.every((e) => e.asset) ? null : "只对已入库的文件",
|
||||
disabled: selected.every((e) => opApplies("writeNfo", e)) ? blockedTip("writeNfo") : "只能刮削视频文件或目录",
|
||||
onSelect: () => act("writeNfo", selected),
|
||||
});
|
||||
items.push({ key: "copyPath", label: "复制路径", icon: ClipboardCopy, onSelect: () => void copyPaths(selected) });
|
||||
@@ -1151,8 +1153,14 @@ export default function FilesPage() {
|
||||
刷新元数据
|
||||
</Button>
|
||||
) : null}
|
||||
{detail.asset ? (
|
||||
<Button size="sm" variant="outline" onClick={() => act("writeNfo", [detail])}>
|
||||
{opApplies("writeNfo", detail) ? (
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
onClick={() => act("writeNfo", [detail])}
|
||||
disabled={!!opDisabledReason("writeNfo", detail, root)}
|
||||
title={opDisabledReason("writeNfo", detail, root) ?? undefined}
|
||||
>
|
||||
<FileDown />
|
||||
刮削
|
||||
</Button>
|
||||
@@ -1224,7 +1232,10 @@ export default function FilesPage() {
|
||||
<CopyPathDialog root={root} entry={dialog.entry} onClose={() => setDialog(null)} />
|
||||
) : null}
|
||||
{dialog?.kind === "refresh" ? (
|
||||
<RefreshMetadataDialog items={dialog.items} write={dialog.write} onClose={() => setDialog(null)} />
|
||||
<RefreshMetadataDialog items={dialog.items} onClose={() => setDialog(null)} />
|
||||
) : null}
|
||||
{dialog?.kind === "scrape" && root ? (
|
||||
<ScrapeDialog items={dialog.items} root={root} onClose={() => setDialog(null)} />
|
||||
) : null}
|
||||
{dialog?.kind === "wizard" ? <OrganizeWizard source={dialog.source} onClose={() => setDialog(null)} /> : null}
|
||||
<ShortcutsDialog open={dialog?.kind === "shortcuts"} onOpenChange={(o) => !o && setDialog(null)} />
|
||||
|
||||
Reference in new issue
Block a user