fix(server): album statistics endpoint (#11924)

This commit is contained in:
Jason Rasmussen 2024-08-20 07:50:36 -04:00 committed by GitHub
parent cde0458dc8
commit ef9a06be5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 111 additions and 111 deletions

View file

@ -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}

View file

@ -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>