mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(server): download assets (#3032)
* refactor: download assets * chore: open api * chore: finish tests, make size configurable * chore: defualt to 4GiB * chore: open api * fix: optional archive size * fix: bugs * chore: cleanup
This commit is contained in:
parent
df9c05bef3
commit
ad343b7b32
53 changed files with 1455 additions and 1403 deletions
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import { bulkDownload } from '$lib/utils/asset-utils';
|
||||
import { fileUploadHandler, openFileUploadDialog } from '$lib/utils/file-uploader';
|
||||
import { downloadArchive } from '$lib/utils/asset-utils';
|
||||
import { api, AssetResponseDto, SharedLinkResponseDto } from '@api';
|
||||
import { dragAndDropFilesStore } from '$lib/stores/drag-and-drop-files.store';
|
||||
import ArrowLeft from 'svelte-material-icons/ArrowLeft.svelte';
|
||||
|
|
@ -38,7 +38,12 @@
|
|||
});
|
||||
|
||||
const downloadAssets = async () => {
|
||||
await bulkDownload('immich-shared', assets, undefined, sharedLink.key);
|
||||
await downloadArchive(
|
||||
`immich-shared.zip`,
|
||||
{ assetIds: assets.map((asset) => asset.id) },
|
||||
undefined,
|
||||
sharedLink.key
|
||||
);
|
||||
};
|
||||
|
||||
const handleUploadAssets = async (files: File[] = []) => {
|
||||
|
|
@ -78,7 +83,7 @@
|
|||
<AssetSelectControlBar assets={selectedAssets} clearSelect={() => (selectedAssets = new Set())}>
|
||||
<CircleIconButton title="Select all" logo={SelectAll} on:click={handleSelectAll} />
|
||||
{#if sharedLink?.allowDownload}
|
||||
<DownloadAction filename="immich-shared" sharedLinkKey={sharedLink.key} />
|
||||
<DownloadAction filename="immich-shared.zip" sharedLinkKey={sharedLink.key} />
|
||||
{/if}
|
||||
{#if isOwned}
|
||||
<RemoveFromSharedLink bind:sharedLink />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue