diff --git a/docs/docs/features/libraries.md b/docs/docs/features/libraries.md index 2fb5a1c56a..6e8246b06c 100644 --- a/docs/docs/features/libraries.md +++ b/docs/docs/features/libraries.md @@ -80,6 +80,10 @@ There is an automatic scan job that is scheduled to run once a day. Its schedule This job also cleans up any libraries stuck in deletion. It is possible to trigger the cleanup by clicking "Scan all libraries" in the library management page. +### Deleting a Library + +When deleting an external library, all assets inside are immediately deleted along with the library. Note that while a library can take a long time to fully delete in the background, it is immediately removed from the library list. If the deletion process is interrupted (for example, due to server restart), it will be cleaned up in the next nightly cron job. The cleanup process can also be manually initiated by clicking the "Scan All Libraries" button in the library list. + ## Usage Let's show a concrete example where we add an existing gallery to Immich. Here, we have the following folders we want to add: diff --git a/web/src/lib/services/library.service.ts b/web/src/lib/services/library.service.ts index 1176e707a6..e465ed0be5 100644 --- a/web/src/lib/services/library.service.ts +++ b/web/src/lib/services/library.service.ts @@ -23,14 +23,13 @@ import { modalManager, toastManager, type ActionItem } from '@immich/ui'; import { mdiInformationOutline, mdiPencilOutline, mdiPlusBoxOutline, mdiSync, mdiTrashCanOutline } from '@mdi/js'; import type { MessageFormatter } from 'svelte-i18n'; -export const getLibrariesActions = ($t: MessageFormatter, libraries: LibraryResponseDto[]) => { +export const getLibrariesActions = ($t: MessageFormatter) => { const ScanAll: ActionItem = { title: $t('scan_all_libraries'), type: $t('command'), icon: mdiSync, onAction: () => handleScanAllLibraries(), shortcuts: { shift: true, key: 'r' }, - $if: () => libraries.length > 0, }; const Create: ActionItem = { diff --git a/web/src/routes/admin/library-management/(list)/+layout.svelte b/web/src/routes/admin/library-management/(list)/+layout.svelte index 5002b92de4..72aa44c5fe 100644 --- a/web/src/routes/admin/library-management/(list)/+layout.svelte +++ b/web/src/routes/admin/library-management/(list)/+layout.svelte @@ -58,7 +58,7 @@ delete owners[id]; }; - const { Create, ScanAll } = $derived(getLibrariesActions($t, libraries)); + const { Create, ScanAll } = $derived(getLibrariesActions($t)); const getActionsForLibrary = (library: LibraryResponseDto) => { const { Detail, Scan, Edit, Delete } = getLibraryActions($t, library);