diff --git a/web/src/lib/components/stats/stat-cards.svelte b/web/src/lib/components/stats/stat-cards.svelte index 5e50223..38b1acc 100644 --- a/web/src/lib/components/stats/stat-cards.svelte +++ b/web/src/lib/components/stats/stat-cards.svelte @@ -5,6 +5,7 @@ import { isSemver, semverIsGreater } from '$lib/utils.ts'; import { env } from '$env/dynamic/public'; import { animate } from 'animejs'; + import { resolve } from '$app/paths'; let moviesCount: string | null = $state(null); let episodeCount: string | null = $state(null); @@ -14,6 +15,9 @@ let releaseUrl: string | null = $state(null); let newestVersion: string | null = $state(null); + let importablesShowsCount: number = $state(0); + let importablesMoviesCount: number = $state(0); + // Elements to animate let showEl: HTMLSpanElement; let episodeEl: HTMLSpanElement; @@ -70,6 +74,15 @@ newestVersion = latestRelease.tag_name.toString().replace(/v*/, ''); releaseUrl = latestRelease.html_url; } + + let importableShows = await client.GET('/api/v1/tv/importable'); + if (!importableShows.error) { + importablesShowsCount = importableShows.data.length; + } + let importableMovies = await client.GET('/api/v1/movies/importable'); + if (!importableMovies.error) { + importablesMoviesCount = importableMovies.data.length; + } }); @@ -94,6 +107,29 @@ {torrentCount ?? 'Error'} + {#if importablesShowsCount > 0} +
+ + + {importablesShowsCount} + + +
+ {/if} + {#if importablesMoviesCount > 0} +
+ + + {importablesMoviesCount} + + +
+ {/if}
{#if semverIsGreater(newestVersion ?? '', installedVersion ?? '') || !isSemver(installedVersion ?? '')}