From 54d4e7c2a432b136a9c85c0fea0b2c1bdddba8b3 Mon Sep 17 00:00:00 2001 From: Fermin Cirella Date: Sat, 13 Jul 2024 02:44:34 -0300 Subject: [PATCH] - Move reader preferences to client-side - Add pages to the library list --- server/Cargo.lock | 2 +- server/Cargo.toml | 2 +- server/src/api/models.rs | 1 + server/src/db.rs | 3 ++ server/src/metadata/koharu.rs | 2 +- web/bun.lockb | Bin 147918 -> 147982 bytes web/package.json | 4 +- web/src/lib/components/list-item.svelte | 7 +++- web/src/lib/components/reader-bar.svelte | 29 +++++++++++++- web/src/lib/components/reader.svelte | 37 +++++++++++------- .../ui/dialog/dialog-content.svelte | 3 +- web/src/lib/models.ts | 3 ++ web/src/lib/reader-store.ts | 2 +- web/src/lib/utils.ts | 3 +- web/src/routes/(app)/g/[id]/+page.svelte | 20 +++++----- .../g/[id]/read/[page]/+layout.server.ts | 8 ---- .../(app)/g/[id]/read/[page]/+layout@.svelte | 31 +++++++++++---- web/svelte.config.js | 1 + web/tailwind.config.ts | 1 + 19 files changed, 107 insertions(+), 52 deletions(-) delete mode 100644 web/src/routes/(app)/g/[id]/read/[page]/+layout.server.ts diff --git a/server/Cargo.lock b/server/Cargo.lock index 9a543b9..d08c06d 100644 --- a/server/Cargo.lock +++ b/server/Cargo.lock @@ -2340,7 +2340,7 @@ dependencies = [ [[package]] name = "server" -version = "1.1.3" +version = "1.1.4" dependencies = [ "anyhow", "async_zip", diff --git a/server/Cargo.toml b/server/Cargo.toml index e566ebb..4b61d3e 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "server" -version = "1.1.3" +version = "1.1.4" edition = "2021" [dependencies] diff --git a/server/src/api/models.rs b/server/src/api/models.rs index b3946bb..d60119b 100644 --- a/server/src/api/models.rs +++ b/server/src/api/models.rs @@ -203,6 +203,7 @@ pub struct ArchiveListItem { pub slug: String, pub hash: String, pub title: String, + pub pages: i16, #[serde(skip_serializing_if = "Option::is_none")] pub cover: Option, #[serde(skip_serializing_if = "<[_]>::is_empty")] diff --git a/server/src/db.rs b/server/src/db.rs index 7077c64..438978c 100644 --- a/server/src/db.rs +++ b/server/src/db.rs @@ -717,6 +717,8 @@ pub async fn search( } } + qb.push(", pages"); + qb.push(", ARRAY_POSITION(") .push_bind(&ids) .push(",id) AS ord"); @@ -741,6 +743,7 @@ pub async fn search( slug: row.get(1), hash: row.get(2), title: row.get(3), + pages: row.get(12), cover, artists: row.get::, _>(5).0, circles: row.get::, _>(6).0, diff --git a/server/src/metadata/koharu.rs b/server/src/metadata/koharu.rs index 701246c..657d483 100644 --- a/server/src/metadata/koharu.rs +++ b/server/src/metadata/koharu.rs @@ -114,7 +114,7 @@ pub fn add_metadata(info: Metadata, archive: &mut db::UpsertArchiveData) -> anyh name: utils::parse_source_name(&url), url: Some(format!( "https://koharu.to{}", - url.split(":").last().unwrap() + url.split(':').last().unwrap() )), }); } diff --git a/web/bun.lockb b/web/bun.lockb index f2549519d597bf0825b6f34906ec113c96176ac5..8ff0f1ad7636124d29bbe45e4efad6fc5821f63b 100755 GIT binary patch delta 23555 zcmeHvd3a6N*Zp^iFrzz(M?2h#mp51X{aI>mxN3*AS#j+E#J~gH@116 z^-DuFVvd<=4W)+G)K*JdQ;pG*_p{C*-tVJ*-@bqRp6B;GJx@Mo?X~vW!`gf8;hb}` zznmn0Fj=12gH0^#8J+hflO$J3%J&4V3L05SlH5VpgH{I}nwe?O94bl8!M_GRJuNc} zGHH*4BsqgWWRN5$&{SJ$TGB8{S_fVRpJPi&mT=WUIv4QOwEUhUp7PDGXQm~OvFAx) zRV2w90)J4-$On`Z5^b4jV^bw5!%;2hOl37bJ!yCjWxN->8}#mK8D0k^11@SbDbsI6 za@r6n6PZ%JCm|>L5I3s$PKECy<>w<6)p$sTZKyp{k{*L6#mH)EMLq1IBR-!$XtUjml-+__|STvo-l9@YF}kK`Gw_Z~&ys%TGmsnxd13N+ZCNG3UUOlN<-7 z0?WY=-D^@as8L7N*E0IkeDw64J=F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wr3S)K@OtE%TxH0D(=kM5cMrRC+Q)F z?z9zsb|FfsAFL2RcY-rau?g4R@RHUdVmC4s=dUT2?nVeRi@m$qe8XP57_=(l?K!IbJRKdIbD4t*wCRM7A9_~df~%5#k3(jKgdTH+CEU@b-S zy$Fp_BUMuz&nIOczPdQ6Ts>Y4g+jZ0cX_I`-|6N%J0 zCn`^x+D)Kjn}8sCN2VWb*m`FC_~M02CK}k1Wc8DAQL?Cb5b;ny3~^#mfbafl4)stL z0iE8pXm9A0*KyTF@s$EIU>Cp~TChdH?kjbOSLMMGdFYMD`)f+v7B`4wNZt*o!eyc8GOi z6@={wt0M*hT|e_dpsr;Cpc<6)(08?mUaW{Bs9*$6{vh8XdsUaN=L_$3Qr zj^g^4m}M*=pChcJTF9@Oew^ckg5o!w_tnL_&rSlrzY3=+P8~r9v8#4E%7Wymqw0%e z7ZG`sz2Tl|OH3MvQ)IiuooaNq`KHEJG509*#SgfOK>RWhSm;CYg??|Zh+SLPD;GR{ zG|u|>_}$RpuUU4b=b^{cHbM$xj^T$xh3sqgeWSt(4_P;d v!kK@t&QWgdGjqn+Gg_*LOBS9r8`>De_Yd&u`hG)$lZg9+g%rAB%gz1|XyM*g diff --git a/web/package.json b/web/package.json index 4e469f9..34fa073 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "web-kit", - "version": "1.1.3", + "version": "1.1.4", "private": true, "scripts": { "dev": "vite dev", @@ -42,8 +42,10 @@ "type": "module", "dependencies": { "@tailwindcss/container-queries": "^0.1.1", + "@types/cookie": "^0.6.0", "bits-ui": "^0.21.10", "clsx": "^2.1.1", + "cookie": "^0.6.0", "dayjs": "^1.11.11", "dotenv": "^16.4.5", "fflate": "^0.8.2", diff --git a/web/src/lib/components/list-item.svelte b/web/src/lib/components/list-item.svelte index e256f9b..0ad37c4 100644 --- a/web/src/lib/components/list-item.svelte +++ b/web/src/lib/components/list-item.svelte @@ -80,7 +80,12 @@
- + +
+ {archive.pages}P +
{ + isMounted = true; + }); + $: { - if (browser) { - document.cookie = `reader=${JSON.stringify($prefs)}; Path=/; Max-Age=${dayjs(dayjs().add(1, 'year')).diff(dayjs(), 'seconds')}`; + if (browser && isMounted) { + document.cookie = cookie.serialize('reader', JSON.stringify($prefs), { + path: '/', + maxAge: dayjs().add(1, 'year').diff(dayjs(), 'seconds'), + }); } } @@ -219,12 +230,26 @@ type="single" value={$prefs.fitMode} onValueChange={onModeChange} + class="flex flex-wrap" > Fit Height + Fill Height + Min Width Max Width Image Width +
+ + ($prefs.minWidth = parseInt(event.currentTarget.value) || undefined)} + /> +
+
({ ...image, state: 'idle', @@ -106,21 +105,25 @@ return; } - const base = `aspect-ratio: ${image.width && image.height && image.width / image.height};`; - switch ($prefs.fitMode) { + case ImageFitMode.MinWidth: + if (image.width && image.height) { + return `min-height: min(${image.height}px, 100%); aspect-ratio: ${image.width / image.height};`; + } + + return; case ImageFitMode.MaxWidth: - if ($prefs.maxWidth && image.width && image.height) { - return base + `max-height: ${($prefs.maxWidth * image.height) / image.width}px;`; + if (image.width && image.height) { + return `min-height: min(${image.height}px, 100%);`; } - return base; + return; case ImageFitMode.ImageWidth: - return base + `max-height: ${image.height}px;`; + return `max-height: ${image.height}px;`; case ImageFitMode.FitHeight: - return base + 'max-height: 100%'; - default: - return base; + return 'max-height: 100%;'; + case ImageFitMode.FillHeight: + return 'min-height: 100%;'; } }; @@ -128,6 +131,8 @@ switch ($prefs.fitMode) { case ImageFitMode.ImageWidth: return ``; + case ImageFitMode.MinWidth: + return `width: ${$prefs.minWidth}px;`; case ImageFitMode.MaxWidth: if ($prefs.maxWidth) { return `max-width: clamp(0px, ${$prefs.maxWidth}px, 100%);`; @@ -136,6 +141,8 @@ } case ImageFitMode.FitHeight: return `width: auto; max-height: 100%;`; + case ImageFitMode.FillHeight: + return `width: auto; min-height: 100%; object-fit: contain;`; } }; @@ -193,7 +200,7 @@ style={getContainerStyle($prefs, image)} > changePage($prevPage)} @@ -205,7 +212,7 @@ on:click={() => ($showBar = !$showBar)} /> changePage($nextPage)} @@ -214,7 +221,7 @@
- {#if previewLayout} + {#if $previewLayout}
@@ -238,7 +245,7 @@ src={`${env.PUBLIC_CDN_URL}/image/${archive.hash}/${image?.filename}`} loading="eager" style={getImageStyle($prefs)} - class="m-auto bg-neutral-500" + class="m-auto" on:error={() => toast.error('Failed to load the page')} />
diff --git a/web/src/lib/components/ui/dialog/dialog-content.svelte b/web/src/lib/components/ui/dialog/dialog-content.svelte index 78b5e01..0751549 100644 --- a/web/src/lib/components/ui/dialog/dialog-content.svelte +++ b/web/src/lib/components/ui/dialog/dialog-content.svelte @@ -1,8 +1,7 @@ + onMount(() => { + const cookiePerfs = cookie.parse(document.cookie); - + if (Object.entries(cookiePerfs).length) { + try { + $prefs = JSON.parse(cookiePerfs.reader) as ReaderPreferences; + } finally { + isMounted = true; + } + } else { + isMounted = true; + } + }); + - +{#if isMounted} + + + +{/if} diff --git a/web/svelte.config.js b/web/svelte.config.js index 3e21b7b..296f38e 100644 --- a/web/svelte.config.js +++ b/web/svelte.config.js @@ -7,6 +7,7 @@ const config = { kit: { adapter: adapter(), alias: { + '~': './src', $assets: './src/assets', }, }, diff --git a/web/tailwind.config.ts b/web/tailwind.config.ts index 00a2e7d..00341ae 100644 --- a/web/tailwind.config.ts +++ b/web/tailwind.config.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-require-imports */ import type { Config } from 'tailwindcss'; import { fontFamily } from 'tailwindcss/defaultTheme';