Files
linkwarden/packages/filesystem/manageFiles.ts
daniel31x13 6b3dba3faf Refactor worker-related functionality and update UI components
- Updated ConfirmationModal to use a callback for toggleModal.
- Modified DeleteUserModal to handle admin checks more robustly.
- Removed unnecessary config usage in SettingsSidebar and updated links.
- Cleaned up TagListing by removing unused context logging.
- Enhanced admin page to redirect non-admin users to the dashboard.
- Simplified API for archiving links by removing unused actions.
- Updated billing settings page for better UI consistency.
- Adjusted password settings page for responsive design.
- Deleted obsolete worker-console page and redirected to background-jobs.
- Added new background-jobs page with worker stats and preservation actions.
- Introduced new API endpoints for fetching worker stats and managing preservations.
- Created new hooks for managing worker-related actions in the router.
- Updated localization files to reflect new UI changes and actions.
- Removed deprecated preservation file handling from filesystem management.
2026-02-12 15:16:22 -05:00

71 lines
1.6 KiB
TypeScript

import { moveFile } from "./moveFile";
import { removeFile } from "./removeFile";
const removeFiles = async (linkId: number, collectionId: number) => {
// PDF
await removeFile({
filePath: `archives/${collectionId}/${linkId}.pdf`,
});
// Images
await removeFile({
filePath: `archives/${collectionId}/${linkId}.png`,
});
await removeFile({
filePath: `archives/${collectionId}/${linkId}.jpeg`,
});
await removeFile({
filePath: `archives/${collectionId}/${linkId}.jpg`,
});
// HTML
await removeFile({
filePath: `archives/${collectionId}/${linkId}.html`,
});
// Preview
await removeFile({
filePath: `archives/preview/${collectionId}/${linkId}.jpeg`,
});
// Readability
await removeFile({
filePath: `archives/${collectionId}/${linkId}_readability.json`,
});
};
const moveFiles = async (linkId: number, from: number, to: number) => {
await moveFile(
`archives/${from}/${linkId}.pdf`,
`archives/${to}/${linkId}.pdf`
);
await moveFile(
`archives/${from}/${linkId}.png`,
`archives/${to}/${linkId}.png`
);
await moveFile(
`archives/${from}/${linkId}.jpeg`,
`archives/${to}/${linkId}.jpeg`
);
await moveFile(
`archives/${from}/${linkId}.jpg`,
`archives/${to}/${linkId}.jpg`
);
await moveFile(
`archives/${from}/${linkId}.html`,
`archives/${to}/${linkId}.html`
);
await moveFile(
`archives/preview/${from}/${linkId}.jpeg`,
`archives/preview/${to}/${linkId}.jpeg`
);
await moveFile(
`archives/${from}/${linkId}_readability.json`,
`archives/${to}/${linkId}_readability.json`
);
};
export { removeFiles, moveFiles };