diff --git a/packages/client/src/core.ts b/packages/client/src/core.ts index 64e8589f9..5f5c1f4ce 100644 --- a/packages/client/src/core.ts +++ b/packages/client/src/core.ts @@ -83,6 +83,7 @@ export type Procedures = { | { key: 'volumes.list'; input: never; result: Array }; mutations: | { key: 'files.copyFiles'; input: LibraryArgs; result: null } + | { key: 'files.cutFiles'; input: LibraryArgs; result: null } | { key: 'files.decryptFiles'; input: LibraryArgs; result: null } | { key: 'files.delete'; input: LibraryArgs; result: null } | { key: 'files.deleteFiles'; input: LibraryArgs; result: null } @@ -189,6 +190,13 @@ export interface FileCopierJobInit { target_path: string; } +export interface FileCutterJobInit { + source_location_id: number; + source_path_id: number; + target_location_id: number; + target_path: string; +} + export interface FileDecryptorJobInit { location_id: number; path_id: number; diff --git a/packages/interface/src/components/explorer/ExplorerContextMenu.tsx b/packages/interface/src/components/explorer/ExplorerContextMenu.tsx index 5f3915421..2a8da8107 100644 --- a/packages/interface/src/components/explorer/ExplorerContextMenu.tsx +++ b/packages/interface/src/components/explorer/ExplorerContextMenu.tsx @@ -106,6 +106,7 @@ export function ExplorerContextMenu(props: PropsWithChildren) { const objectValidator = useLibraryMutation('jobs.objectValidator'); const rescanLocation = useLibraryMutation('locations.fullRescan'); const copyFiles = useLibraryMutation('files.copyFiles'); + const cutFiles = useLibraryMutation('files.cutFiles'); return (
@@ -150,7 +151,13 @@ export function ExplorerContextMenu(props: PropsWithChildren) { target_path: params.path }); } else { - // cut here + store.locationId && + cutFiles.mutate({ + source_location_id: store.cutCopyState.sourceLocationId, + source_path_id: store.cutCopyState.sourcePathId, + target_location_id: store.locationId, + target_path: params.path + }); } }} icon={Clipboard}