From 8c84eb2b4e11904eaaed4b1021aec6052b039875 Mon Sep 17 00:00:00 2001 From: maxDorninger <97409287+maxDorninger@users.noreply.github.com> Date: Sun, 22 Jun 2025 18:05:21 +0200 Subject: [PATCH] format frontend code --- web/package.json | 4 +- web/src/lib/components/add-show-card.svelte | 4 +- web/src/lib/components/app-sidebar.svelte | 20 +- .../components/download-season-dialog.svelte | 2 +- web/src/lib/components/login-form.svelte | 480 +++++++++--------- web/src/lib/components/nav-main.svelte | 10 +- web/src/lib/components/nav-projects.svelte | 24 +- web/src/lib/components/nav-user.svelte | 40 +- .../components/request-season-dialog.svelte | 3 +- .../components/season-requests-table.svelte | 10 +- web/src/lib/components/show-picture.svelte | 17 +- .../lib/components/ui/button/button.svelte | 26 +- .../components/ui/checkbox/checkbox.svelte | 40 +- web/src/lib/components/ui/checkbox/index.ts | 4 +- .../ui/tooltip/tooltip-content.svelte | 12 +- web/src/lib/components/user-data-table.svelte | 3 +- web/src/lib/components/user-details.svelte | 4 +- web/src/lib/components/user-settings.svelte | 3 +- web/src/lib/types.ts | 2 - web/src/lib/utils.ts | 1 - web/src/routes/+layout.ts | 2 +- web/src/routes/+page.svelte | 18 +- web/src/routes/dashboard/+layout.ts | 4 +- web/src/routes/dashboard/+page.svelte | 22 +- web/src/routes/dashboard/+page.ts | 3 +- web/src/routes/dashboard/about/+page.svelte | 30 +- .../routes/dashboard/settings/+page.svelte | 18 +- web/src/routes/dashboard/settings/+page.ts | 1 - web/src/routes/dashboard/tv/+page.svelte | 12 +- web/src/routes/dashboard/tv/+page.ts | 2 +- .../dashboard/tv/[showId=uuid]/+layout.svelte | 6 +- .../dashboard/tv/[showId=uuid]/+layout.ts | 1 - .../dashboard/tv/[showId=uuid]/+page.svelte | 298 +++++------ .../[SeasonId=uuid]/+page.svelte | 12 +- .../tv/[showId=uuid]/[SeasonId=uuid]/+page.ts | 3 - .../routes/dashboard/tv/add-show/+page.svelte | 5 +- .../routes/dashboard/tv/requests/+layout.ts | 1 - .../routes/dashboard/tv/torrents/+page.svelte | 24 +- web/src/routes/dashboard/tv/torrents/+page.ts | 3 +- web/src/routes/login/+page.ts | 1 - web/vite.config.ts | 1 - 41 files changed, 568 insertions(+), 608 deletions(-) diff --git a/web/package.json b/web/package.json index 063b5c2..53fa0b0 100644 --- a/web/package.json +++ b/web/package.json @@ -17,10 +17,10 @@ "@eslint/compat": "^1.2.5", "@eslint/js": "^9.18.0", "@fontsource/fira-mono": "^5.0.0", - "@lucide/svelte": "^0.482.0", + "@lucide/svelte": "^0.482.0", "@neoconfetti/svelte": "^2.0.0", "@sveltejs/adapter-static": "^3.0.8", - "@sveltejs/enhanced-img": "^0.6.0", + "@sveltejs/enhanced-img": "^0.6.0", "@sveltejs/kit": "^2.16.0", "@sveltejs/vite-plugin-svelte": "^5.0.0", "@tailwindcss/container-queries": "^0.1.1", diff --git a/web/src/lib/components/add-show-card.svelte b/web/src/lib/components/add-show-card.svelte index 05c0e97..5805ce2 100644 --- a/web/src/lib/components/add-show-card.svelte +++ b/web/src/lib/components/add-show-card.svelte @@ -7,7 +7,7 @@ import {base} from '$app/paths'; import type {MetaDataProviderShowSearchResult} from '$lib/types.js'; - const apiUrl = env.PUBLIC_API_URL + const apiUrl = env.PUBLIC_API_URL; let loading = $state(false); let errorMessage = $state(null); let {result}: { result: MetaDataProviderShowSearchResult } = $props(); @@ -33,7 +33,7 @@ } - + {result.name} diff --git a/web/src/lib/components/app-sidebar.svelte b/web/src/lib/components/app-sidebar.svelte index 778890b..3636030 100644 --- a/web/src/lib/components/app-sidebar.svelte +++ b/web/src/lib/components/app-sidebar.svelte @@ -1,6 +1,6 @@ @@ -74,9 +74,9 @@ - {#snippet child({props})} + {#snippet child({props})} - Media Manager Logo + Media Manager Logo
Media Manager v{PUBLIC_VERSION} @@ -88,11 +88,11 @@ - + - + - + diff --git a/web/src/lib/components/download-season-dialog.svelte b/web/src/lib/components/download-season-dialog.svelte index 1662344..235b693 100644 --- a/web/src/lib/components/download-season-dialog.svelte +++ b/web/src/lib/components/download-season-dialog.svelte @@ -13,7 +13,7 @@ import * as Select from '$lib/components/ui/select/index.js'; import * as Table from '$lib/components/ui/table/index.js'; - const apiUrl = env.PUBLIC_API_URL + const apiUrl = env.PUBLIC_API_URL; let {show} = $props(); let dialogueState = $state(false); let selectedSeasonNumber: number = $state(1); diff --git a/web/src/lib/components/login-form.svelte b/web/src/lib/components/login-form.svelte index b73870d..2b08a3e 100644 --- a/web/src/lib/components/login-form.svelte +++ b/web/src/lib/components/login-form.svelte @@ -1,267 +1,265 @@ {#snippet oauthLogin()} - - {#await oauthProvider} - - {:then result} - {#if result.oauth_name != null} -
- - Or continue with - -
- - {/if} - {/await} + {#await oauthProvider} + + {:then result} + {#if result.oauth_name != null} +
+ + Or continue with + +
+ + {/if} + {/await} {/snippet} - - - - Login - Enter your email below to login to your account - - -
-
- - -
-
+ + + + Login + Enter your email below to login to your account + + + +
+ + +
+
+ + +
- {#if errorMessage} -

{errorMessage}

- {/if} + {#if errorMessage} +

{errorMessage}

+ {/if} - - + + - {@render oauthLogin()} + {@render oauthLogin()} -
- -
-
-
-
- - - - Sign up - Enter your email and password below to sign up. - - -
-
- - -
-
-
- -
- -
+
+ +
+ + + + + + + Sign up + Enter your email and password below to sign up. + + + +
+ + +
+
+
+ +
+ +
- {#if errorMessage} -

{errorMessage}

- {/if} + {#if errorMessage} +

{errorMessage}

+ {/if} - - - {@render oauthLogin()} + + + {@render oauthLogin()} -
- -
-
-
-
+
+ +
+
+
+
diff --git a/web/src/lib/components/nav-main.svelte b/web/src/lib/components/nav-main.svelte index 9e46458..1bbf999 100644 --- a/web/src/lib/components/nav-main.svelte +++ b/web/src/lib/components/nav-main.svelte @@ -26,24 +26,24 @@ {#each items as mainItem (mainItem.title)} - {#snippet child({props})} + {#snippet child({props})} {#snippet tooltipContent()} {mainItem.title} {/snippet} - {#snippet child({props})} + {#snippet child({props})} - + {mainItem.title} {/snippet} {#if mainItem.items?.length} - {#snippet child({props})} + {#snippet child({props})} - + Toggle {/snippet} diff --git a/web/src/lib/components/nav-projects.svelte b/web/src/lib/components/nav-projects.svelte index 070b364..4e6406a 100644 --- a/web/src/lib/components/nav-projects.svelte +++ b/web/src/lib/components/nav-projects.svelte @@ -1,7 +1,7 @@ @@ -18,51 +18,51 @@ - {#snippet child({props})} + {#snippet child({props})} - +
- +
- +
{/snippet}
- +
- +
- + goto(base + '/dashboard/settings#me')}> My Account - + handleLogout()}> - + Log out
diff --git a/web/src/lib/components/request-season-dialog.svelte b/web/src/lib/components/request-season-dialog.svelte index abafcae..7925df1 100644 --- a/web/src/lib/components/request-season-dialog.svelte +++ b/web/src/lib/components/request-season-dialog.svelte @@ -8,9 +8,8 @@ import type {CreateSeasonRequest, PublicShow, Quality} from '$lib/types.js'; import {getFullyQualifiedShowName, getTorrentQualityString} from '$lib/utils.js'; import {toast} from 'svelte-sonner'; - import {browser} from "$app/environment"; - const apiUrl = env.PUBLIC_API_URL + const apiUrl = env.PUBLIC_API_URL; let {show}: { show: PublicShow } = $props(); let dialogOpen = $state(false); diff --git a/web/src/lib/components/season-requests-table.svelte b/web/src/lib/components/season-requests-table.svelte index a118f2a..62afd13 100644 --- a/web/src/lib/components/season-requests-table.svelte +++ b/web/src/lib/components/season-requests-table.svelte @@ -10,7 +10,7 @@ import {goto} from '$app/navigation'; import {base} from '$app/paths'; - const apiUrl = env.PUBLIC_API_URL + const apiUrl = env.PUBLIC_API_URL; let { requests, filter = () => { @@ -124,7 +124,7 @@ {request.authorized_by?.email ?? 'N/A'} - + {#if user().is_superuser}