From fadab73b6e8b3d9e6453f64e25a480b0f299a24a Mon Sep 17 00:00:00 2001 From: Ayush Sehrawat <69469790+AyushSehrawat@users.noreply.github.com> Date: Wed, 10 Jul 2024 13:21:49 +0530 Subject: [PATCH] feat: add lazy loading for images in statistics and home pages (#502) fix: min/max filesize being returned undefined --- frontend/src/lib/components/home-items.svelte | 2 + .../src/lib/components/service-status.svelte | 135 ------------------ frontend/src/lib/forms/helpers.ts | 8 +- frontend/src/routes/+page.svelte | 1 + .../routes/settings/general/+page.server.ts | 2 + frontend/src/routes/statistics/+page.svelte | 1 + 6 files changed, 10 insertions(+), 139 deletions(-) delete mode 100644 frontend/src/lib/components/service-status.svelte diff --git a/frontend/src/lib/components/home-items.svelte b/frontend/src/lib/components/home-items.svelte index b1430dbe..e0ebabf3 100644 --- a/frontend/src/lib/components/home-items.svelte +++ b/frontend/src/lib/components/home-items.svelte @@ -43,6 +43,7 @@ {item.title
diff --git a/frontend/src/lib/components/service-status.svelte b/frontend/src/lib/components/service-status.svelte deleted file mode 100644 index 69356c9a..00000000 --- a/frontend/src/lib/components/service-status.svelte +++ /dev/null @@ -1,135 +0,0 @@ - - -
- {#each servicesStatus as status} -
-

{status.name}

- {#each status.services as service} -
- {#if service.status} - - - - - {:else} - - - - - {/if} -

{service.name}

-
- {/each} -
- {/each} -
diff --git a/frontend/src/lib/forms/helpers.ts b/frontend/src/lib/forms/helpers.ts index c0288c7a..bf9f3358 100644 --- a/frontend/src/lib/forms/helpers.ts +++ b/frontend/src/lib/forms/helpers.ts @@ -69,10 +69,10 @@ export function generalSettingsToPass(data: any) { rclone_path: data.data.symlink.rclone_path, library_path: data.data.symlink.library_path, separate_anime_dirs: data.data.symlink.separate_anime_dirs, - movie_filesize_min: data.data.movie_filesize_min, - movie_filesize_max: data.data.movie_filesize_max, - episode_filesize_min: data.data.episode_filesize_min, - episode_filesize_max: data.data.episode_filesize_max, + movie_filesize_min: data.data.downloaders.movie_filesize_min, + movie_filesize_max: data.data.downloaders.movie_filesize_max, + episode_filesize_min: data.data.downloaders.episode_filesize_min, + episode_filesize_max: data.data.downloaders.episode_filesize_max, realdebrid_enabled: data.data.downloaders.real_debrid.enabled, realdebrid_api_key: data.data.downloaders.real_debrid?.api_key || '', realdebrid_proxy_enabled: data.data.downloaders.real_debrid?.proxy_enabled || false, diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte index e62a657b..1251fe80 100644 --- a/frontend/src/routes/+page.svelte +++ b/frontend/src/routes/+page.svelte @@ -138,6 +138,7 @@ >{trendingAll.name} diff --git a/frontend/src/routes/settings/general/+page.server.ts b/frontend/src/routes/settings/general/+page.server.ts index 1a339b16..0d14eff6 100644 --- a/frontend/src/routes/settings/general/+page.server.ts +++ b/frontend/src/routes/settings/general/+page.server.ts @@ -26,7 +26,9 @@ export const load: PageServerLoad = async ({ fetch }) => { } let data: any = await getPartialSettings(); + console.log('data', data); let toPassToSchema = generalSettingsToPass(data); + console.log('toPassToSchema', toPassToSchema); return { form: await superValidate(toPassToSchema, zod(generalSettingsSchema)) diff --git a/frontend/src/routes/statistics/+page.svelte b/frontend/src/routes/statistics/+page.svelte index 99aad5c7..cd7ada03 100644 --- a/frontend/src/routes/statistics/+page.svelte +++ b/frontend/src/routes/statistics/+page.svelte @@ -243,6 +243,7 @@ {item.title}