Skip to content

Commit

Permalink
feat: add lazy loading for images in statistics and home pages (#502)
Browse files Browse the repository at this point in the history
fix: min/max filesize being returned undefined
  • Loading branch information
AyushSehrawat authored Jul 10, 2024
1 parent 71e6365 commit fadab73
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 139 deletions.
2 changes: 2 additions & 0 deletions frontend/src/lib/components/home-items.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<img
src="https://image.tmdb.org/t/p/w342{item.poster_path}"
alt={item.title || item.name}
loading="lazy"
class="h-full w-full object-cover object-center transition-all duration-300 ease-in-out group-hover:scale-105"
/>
<div
Expand Down Expand Up @@ -84,6 +85,7 @@
<img
src={`https://image.tmdb.org/t/p/w342${item.poster_path}`}
alt={item.title || item.name}
loading="lazy"
class="h-full w-full object-cover object-center transition-all duration-300 ease-in-out group-hover:scale-105"
/>
</div>
Expand Down
135 changes: 0 additions & 135 deletions frontend/src/lib/components/service-status.svelte

This file was deleted.

8 changes: 4 additions & 4 deletions frontend/src/lib/forms/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions frontend/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
><img
src="https://image.tmdb.org/t/p/w342{trendingAll.backdrop_path}"
alt={trendingAll.name}
loading="lazy"
class="size-full object-cover object-center transition-all duration-300 ease-in-out group-hover:scale-105"
/></span
>
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/routes/settings/general/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions frontend/src/routes/statistics/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
<img
src="{baseUrl}{item.imdb_id}/img"
alt={item.title}
loading="lazy"
class="h-full w-full object-cover object-center transition-all duration-300 ease-in-out group-hover:scale-105"
/>
<!-- <div
Expand Down

0 comments on commit fadab73

Please sign in to comment.