From 585bc0cb4993323c855cf4112491b5c55bfcd611 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 27 Aug 2023 17:40:50 -0700
Subject: feat(manga): chapter rounding

---
 src/routes/settings/+page.svelte | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

(limited to 'src/routes/settings/+page.svelte')

diff --git a/src/routes/settings/+page.svelte b/src/routes/settings/+page.svelte
index f7b64296..32ecfed8 100644
--- a/src/routes/settings/+page.svelte
+++ b/src/routes/settings/+page.svelte
@@ -5,10 +5,12 @@
 	import { chapterDatabase } from '$lib/chapterDatabase';
 	import cacheMangaMinutes from '../../stores/cacheMangaMinutes';
 	import cacheMinutes from '../../stores/cacheMinutes';
+	import roundDownChapters from '../../stores/roundDownChapters';
 
 	export let data;
 
 	$: displayingUnresolved = $displayUnresolved === 'true';
+	$: roundingDownChapters = $roundDownChapters === 'true';
 	$: mangaClosed = $closeMangaByDefault === 'true';
 	$: animeClosed = $closeAnimeByDefault === 'true';
 
@@ -44,13 +46,17 @@
 					displayingUnresolved ? displayUnresolved.set('false') : displayUnresolved.set('true')}
 				>{displayingUnresolved ? 'Hide' : 'Show'} unresolved</a
 			>
+			<small style="opacity: 50%;">Displays unresolved chapter counts as "?"</small>
 		</li>
 		<li>
-			<a href="#" on:click={pruneUnresolved}
-				>Prune <b>ALL</b> cached, unresolved manga (for instant re-cache)</a
+			<a
+				href="#"
+				on:click={() =>
+					roundingDownChapters ? roundDownChapters.set('false') : roundDownChapters.set('true')}
+				>{roundingDownChapters ? 'Round down' : 'Maintain'} chapters</a
 			>
+			<small style="opacity: 50%;">50/50.6 would <b>not</b> be due</small>
 		</li>
-		<li><a href="#" on:click={pruneAll}>Prune <b>ALL</b> cached manga</a></li>
 		<li>
 			<a
 				href="#"
@@ -67,6 +73,10 @@
 				>{mangaClosed ? 'Expand' : 'Close'} manga panel by default</a
 			>
 		</li>
+		<li>
+			<a href="#" on:click={pruneUnresolved}>Re-cache <b>ALL</b> unresolved manga</a>
+		</li>
+		<li><a href="#" on:click={pruneAll}>Re-cache <b>ALL</b> manga</a></li>
 		<li>
 			Re-cache <b>ALL</b> media keys every <input type="number" bind:value={$cacheMinutes} /> minutes
 		</li>
-- 
cgit v1.2.3

