mirror of
https://github.com/KevinMidboe/immich.git
synced 2026-02-14 04:09:22 +00:00
feat (server, web): Implement Archive (#2225)
* feat (server, web): add archive * chore: generate api * feat (web): add empty placeholder for archive page * chore: remove title on favorites page Duplicates sidebar selection. Two pages (Archive and Favorites) are consistent now * refactor (web): create EmptyPlaceholder component for empty pages * fixed menu close button not close: * fix (web): remove not necessary store call * test (web): simplify asset tests code * test (web): simplify asset tests code * chore (server): remove isArchived while uploading * chore (server): remove isArchived from typesense schema * chore: generate api * fix (web): delete asset from archive page * chore: change archive asset count endpoint old endpoint: /asset/archived-count-by-user-id new endpoint: /asset/stat/archive * chore: generate api --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
import { assetStore } from '$lib/stores/assets.store';
|
||||
import { addAssetsToAlbum, bulkDownload } from '$lib/utils/asset-utils';
|
||||
import { AlbumResponseDto, api, SharedLinkType } from '@api';
|
||||
import ArchiveArrowDownOutline from 'svelte-material-icons/ArchiveArrowDownOutline.svelte';
|
||||
import Close from 'svelte-material-icons/Close.svelte';
|
||||
import CloudDownloadOutline from 'svelte-material-icons/CloudDownloadOutline.svelte';
|
||||
import DeleteOutline from 'svelte-material-icons/DeleteOutline.svelte';
|
||||
@@ -69,6 +70,27 @@
|
||||
isShowAddMenu = !isShowAddMenu;
|
||||
};
|
||||
|
||||
const handleArchive = async () => {
|
||||
let cnt = 0;
|
||||
for (const asset of $selectedAssets) {
|
||||
if (!asset.isArchived) {
|
||||
api.assetApi.updateAsset(asset.id, {
|
||||
isArchived: true
|
||||
});
|
||||
|
||||
assetStore.removeAsset(asset.id);
|
||||
cnt = cnt + 1;
|
||||
}
|
||||
}
|
||||
|
||||
notificationController.show({
|
||||
message: `Archived ${cnt}`,
|
||||
type: NotificationType.Info
|
||||
});
|
||||
|
||||
assetInteractionStore.clearMultiselect();
|
||||
};
|
||||
|
||||
const handleAddToFavorites = () => {
|
||||
isShowAddMenu = false;
|
||||
|
||||
@@ -162,6 +184,11 @@
|
||||
logo={ShareVariantOutline}
|
||||
on:click={handleCreateSharedLink}
|
||||
/>
|
||||
<CircleIconButton
|
||||
title="Archive"
|
||||
logo={ArchiveArrowDownOutline}
|
||||
on:click={handleArchive}
|
||||
/>
|
||||
<CircleIconButton
|
||||
title="Download"
|
||||
logo={CloudDownloadOutline}
|
||||
|
||||
Reference in New Issue
Block a user