refactor: download manager (#17935)

This commit is contained in:
Jason Rasmussen 2025-04-28 14:21:24 -04:00 committed by GitHub
parent f64e6f5dc3
commit 895b2bf5cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 17 additions and 23 deletions

View file

@ -1,11 +1,11 @@
<script lang="ts">
import { type DownloadProgress, downloadManager, downloadStore } from '$lib/stores/download-store.svelte';
import { type DownloadProgress, downloadManager } from '$lib/managers/download-manager.svelte';
import { locale } from '$lib/stores/preferences.store';
import { mdiClose } from '@mdi/js';
import { t } from 'svelte-i18n';
import { fly, slide } from 'svelte/transition';
import { getByteUnitString } from '../../utils/byte-units';
import CircleIconButton from '../elements/buttons/circle-icon-button.svelte';
import { mdiClose } from '@mdi/js';
import { t } from 'svelte-i18n';
const abort = (downloadKey: string, download: DownloadProgress) => {
download.abort?.abort();
@ -13,15 +13,15 @@
};
</script>
{#if downloadStore.isDownloading}
{#if downloadManager.isDownloading}
<div
transition:fly={{ x: -100, duration: 350 }}
class="fixed bottom-10 start-2 z-[10000] max-h-[270px] w-[315px] rounded-2xl border bg-immich-bg p-4 text-sm shadow-sm"
>
<p class="mb-2 text-xs text-gray-500">{$t('downloading').toUpperCase()}</p>
<div class="my-2 mb-2 flex max-h-[200px] flex-col overflow-y-auto text-sm">
{#each Object.keys(downloadStore.assets) as downloadKey (downloadKey)}
{@const download = downloadStore.assets[downloadKey]}
{#each Object.keys(downloadManager.assets) as downloadKey (downloadKey)}
{@const download = downloadManager.assets[downloadKey]}
<div class="mb-2 flex place-items-center" transition:slide>
<div class="w-full pe-10">
<div class="flex place-items-center justify-between gap-2 text-xs font-medium">