From fef3d89d68f47204b9ae4bd5b61d941a2e069db0 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Tue, 19 Sep 2023 16:04:25 -0700
Subject: feat(manga): single date construct

---
 src/lib/List/Due/MangaList.svelte | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'src/lib/List/Due/MangaList.svelte')

diff --git a/src/lib/List/Due/MangaList.svelte b/src/lib/List/Due/MangaList.svelte
index cf7f1017..dce467aa 100644
--- a/src/lib/List/Due/MangaList.svelte
+++ b/src/lib/List/Due/MangaList.svelte
@@ -40,14 +40,16 @@
 		if ($lastPruneTimes.chapters === 1) {
 			lastPruneTimes.setKey('chapters', new Date().getTime());
 		} else {
+			const currentDate = new Date();
+
 			if (
-				(new Date().getTime() - $lastPruneTimes.chapters) / 1000 / 60 >
+				(currentDate.getTime() - $lastPruneTimes.chapters) / 1000 / 60 >
 				$settings.cacheMangaMinutes
 			) {
 				const unresolved = await chapterDatabase.chapters.where('chapters').equals(-1).toArray();
 				const ids = unresolved.map((m) => m.id);
 
-				lastPruneTimes.setKey('chapters', new Date().getTime());
+				lastPruneTimes.setKey('chapters', currentDate.getTime());
 				await chapterDatabase.chapters.bulkDelete(ids);
 			}
 		}
-- 
cgit v1.2.3

