diff --git a/web/src/lib/components/add-media-card.svelte b/web/src/lib/components/add-media-card.svelte index c3b172d..e4d667d 100644 --- a/web/src/lib/components/add-media-card.svelte +++ b/web/src/lib/components/add-media-card.svelte @@ -2,7 +2,7 @@ import { Button } from '$lib/components/ui/button/index.js'; import * as Card from '$lib/components/ui/card/index.js'; import { ImageOff } from 'lucide-svelte'; - import {goto, invalidateAll} from '$app/navigation'; + import { goto, invalidateAll } from '$app/navigation'; import { resolve } from '$app/paths'; import type { components } from '$lib/api/api'; import client from '$lib/api'; @@ -40,13 +40,13 @@ data = response.data; } - if (isShow) { - await goto(resolve('/dashboard/tv/[showId]', {showId: data?.id ?? ''})); + if (isShow) { + await goto(resolve('/dashboard/tv/[showId]', { showId: data?.id ?? '' })); } else { - await goto(resolve('/dashboard/movies/[movieId]', {movieId: data?.id ?? ''})); + await goto(resolve('/dashboard/movies/[movieId]', { movieId: data?.id ?? '' })); } - await invalidateAll() - loading = false; + await invalidateAll(); + loading = false; } diff --git a/web/src/lib/components/stats/stat-cards.svelte b/web/src/lib/components/stats/stat-cards.svelte index 5a68dad..13aaeb4 100644 --- a/web/src/lib/components/stats/stat-cards.svelte +++ b/web/src/lib/components/stats/stat-cards.svelte @@ -7,14 +7,14 @@ import { animate } from 'animejs'; import { resolve } from '$app/paths'; - let {showCount, moviesCount}: {showCount: number, moviesCount: number} = $props(); + let { showCount, moviesCount }: { showCount: number; moviesCount: number } = $props(); - let episodeCount: number= $state(0); + let episodeCount: number = $state(0); let episodeCountString: string = $derived(episodeCount.toString().padStart(3, '0')); let torrentCount: number = $state(0); - let torrentCountString: string = $derived(torrentCount.toString().padStart(3, '0')); + let torrentCountString: string = $derived(torrentCount.toString().padStart(3, '0')); - let installedVersion: string | undefined = env.PUBLIC_VERSION?.replace(/v*/, ''); + let installedVersion: string | undefined = env.PUBLIC_VERSION?.replace(/v*/, ''); let releaseUrl: string | null = $state(null); let newestVersion: string | null = $state(null); @@ -42,25 +42,25 @@ }); } - client.GET('/api/v1/torrent').then(res => { - if (!res.error) { - torrentCount = res.data.length; - } - }); - client.GET('/api/v1/tv/episodes/count').then(res => { - if (!res.error) { - episodeCount = Number(res.data); - } - }); + client.GET('/api/v1/torrent').then((res) => { + if (!res.error) { + torrentCount = res.data.length; + } + }); + client.GET('/api/v1/tv/episodes/count').then((res) => { + if (!res.error) { + episodeCount = Number(res.data); + } + }); onMount(async () => { - animateCounter(showEl, showCount, 3); + animateCounter(showEl, showCount, 3); - animateCounter(episodeEl, episodeCount, 3); + animateCounter(episodeEl, episodeCount, 3); - animateCounter(moviesEl, moviesCount, 3); + animateCounter(moviesEl, moviesCount, 3); - animateCounter(torrentEl, torrentCount, 3); + animateCounter(torrentEl, torrentCount, 3); let releases = await fetch('https://api.github.com/repos/maxdorninger/mediamanager/releases'); if (releases.ok) { @@ -124,7 +124,7 @@ href={releaseUrl ?? 'https://github.com/maxdorninger/MediaManager/releases'} class="underline" > - {isSemver(installedVersion ?? "") ? "v" : ""}{installedVersion} → v{newestVersion} + {isSemver(installedVersion ?? '') ? 'v' : ''}{installedVersion} → v{newestVersion} {/if} diff --git a/web/src/routes/dashboard/+layout.ts b/web/src/routes/dashboard/+layout.ts index 9759e27..dba7256 100644 --- a/web/src/routes/dashboard/+layout.ts +++ b/web/src/routes/dashboard/+layout.ts @@ -18,7 +18,7 @@ export const load: LayoutLoad = async ({ fetch }) => { } return { user: data, - tvShows: await client.GET('/api/v1/tv/shows', { fetch: fetch }).then(res => res.data), - movies: await client.GET('/api/v1/movies', { fetch: fetch }).then(res => res.data), + tvShows: await client.GET('/api/v1/tv/shows', { fetch: fetch }).then((res) => res.data), + movies: await client.GET('/api/v1/movies', { fetch: fetch }).then((res) => res.data) }; }; diff --git a/web/src/routes/dashboard/+page.svelte b/web/src/routes/dashboard/+page.svelte index c3d8448..7177789 100644 --- a/web/src/routes/dashboard/+page.svelte +++ b/web/src/routes/dashboard/+page.svelte @@ -8,8 +8,8 @@ import { onMount } from 'svelte'; import client from '$lib/api'; import type { components } from '$lib/api/api.d.ts'; - import type { PageProps } from './$types'; - let {data}: PageProps = $props(); + import type { PageProps } from './$types'; + let { data }: PageProps = $props(); let recommendedShows: components['schemas']['MetaDataProviderSearchResult'][] = []; let showsLoading = true; @@ -60,7 +60,8 @@
Welcome to MediaManager!
- +

Trending Shows

diff --git a/web/src/routes/dashboard/movies/+page.svelte b/web/src/routes/dashboard/movies/+page.svelte index a221e03..a9d56fb 100644 --- a/web/src/routes/dashboard/movies/+page.svelte +++ b/web/src/routes/dashboard/movies/+page.svelte @@ -1,90 +1,89 @@ - Movies - MediaManager - + Movies - MediaManager +
-
- - - - - - - -
+
+ + + + + + + +
-

Movies

- {#if importableMovies().length > 0} -
- {#each importableMovies() as importable (importable.directory)} - - - Import movie - - - {/each} -
- {/if} - {#await data.movies} - - {:then movies} -
- {#each movies as movie (movie.id)} - - - - {getFullyQualifiedMediaName(movie)} - {movie.overview} - - - - - - - {:else} -
No movies added yet.
- {/each} -
- {/await} +

Movies

+ {#if importableMovies().length > 0} +
+ {#each importableMovies() as importable (importable.directory)} + + + Import movie + + + {/each} +
+ {/if} + {#await data.movies} + + {:then movies} +
+ {#each movies as movie (movie.id)} + + + + {getFullyQualifiedMediaName(movie)} + {movie.overview} + + + + + + + {:else} +
No movies added yet.
+ {/each} +
+ {/await}
diff --git a/web/src/routes/dashboard/tv/+page.svelte b/web/src/routes/dashboard/tv/+page.svelte index b5207e8..eb1a98b 100644 --- a/web/src/routes/dashboard/tv/+page.svelte +++ b/web/src/routes/dashboard/tv/+page.svelte @@ -1,92 +1,91 @@ - TV Shows - MediaManager - + TV Shows - MediaManager +
-
- - - - - - - -
+
+ + + + + + + +
-

- TV Shows -

- {#if importableShows().length > 0} -
- {#each importableShows() as importable (importable.directory)} - - - Import TV show - - - {/each} -
- {/if} - {#await data.tvShows} - - {:then tvShows} -
- {#each tvShows as show (show.id)} - - - - {getFullyQualifiedMediaName(show)} - {show.overview} - - - - - - - {:else} -
No TV shows added yet.
- {/each} -
- {/await} +

+ TV Shows +

+ {#if importableShows().length > 0} +
+ {#each importableShows() as importable (importable.directory)} + + + Import TV show + + + {/each} +
+ {/if} + {#await data.tvShows} + + {:then tvShows} +
+ {#each tvShows as show (show.id)} + + + + {getFullyQualifiedMediaName(show)} + {show.overview} + + + + + + + {:else} +
No TV shows added yet.
+ {/each} +
+ {/await}