mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix(server): album statistics endpoint (#11924)
This commit is contained in:
parent
cde0458dc8
commit
ef9a06be5c
14 changed files with 111 additions and 111 deletions
|
|
@ -1,13 +1,13 @@
|
|||
<script lang="ts">
|
||||
import { type AlbumCountResponseDto, getAlbumCount } from '@immich/sdk';
|
||||
import { type AlbumStatisticsResponseDto, getAlbumStatistics } from '@immich/sdk';
|
||||
import LoadingSpinner from '$lib/components/shared-components/loading-spinner.svelte';
|
||||
import { t } from 'svelte-i18n';
|
||||
|
||||
export let albumCountType: keyof AlbumCountResponseDto;
|
||||
export let albumType: keyof AlbumStatisticsResponseDto;
|
||||
|
||||
const handleAlbumCount = async () => {
|
||||
try {
|
||||
return await getAlbumCount();
|
||||
return await getAlbumStatistics();
|
||||
} catch {
|
||||
return { owned: 0, shared: 0, notShared: 0 };
|
||||
}
|
||||
|
|
@ -18,6 +18,6 @@
|
|||
<LoadingSpinner />
|
||||
{:then data}
|
||||
<div>
|
||||
<p>{$t('albums_count', { values: { count: data[albumCountType] } })}</p>
|
||||
<p>{$t('albums_count', { values: { count: data[albumType] } })}</p>
|
||||
</div>
|
||||
{/await}
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@
|
|||
bind:isSelected={isSharingSelected}
|
||||
>
|
||||
<svelte:fragment slot="moreInformation">
|
||||
<MoreInformationAlbums albumCountType="shared" />
|
||||
<MoreInformationAlbums albumType="shared" />
|
||||
</svelte:fragment>
|
||||
</SideBarLink>
|
||||
{/if}
|
||||
|
|
@ -100,7 +100,7 @@
|
|||
</SideBarLink>
|
||||
<SideBarLink title={$t('albums')} routeId="/(user)/albums" icon={mdiImageAlbum} flippedLogo>
|
||||
<svelte:fragment slot="moreInformation">
|
||||
<MoreInformationAlbums albumCountType="owned" />
|
||||
<MoreInformationAlbums albumType="owned" />
|
||||
</svelte:fragment>
|
||||
</SideBarLink>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue