From a8ab5b5345d5fa3dbb3d865268b70955a7445022 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 6 Dec 2023 00:23:21 -0800 Subject: feat(manga): mal reading time --- src/lib/Media/manga.ts | 2 ++ src/lib/Tools/Wrapped.svelte | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/Media/manga.ts b/src/lib/Media/manga.ts index d9007877..af08d4eb 100644 --- a/src/lib/Media/manga.ts +++ b/src/lib/Media/manga.ts @@ -124,3 +124,5 @@ export const chapterCount = async ( return Number(lastChapter); }; + +export const estimatedDayReading = (chapters: number) => chapters / 164; diff --git a/src/lib/Tools/Wrapped.svelte b/src/lib/Tools/Wrapped.svelte index e454f194..1914e29b 100644 --- a/src/lib/Tools/Wrapped.svelte +++ b/src/lib/Tools/Wrapped.svelte @@ -17,6 +17,7 @@ import { page } from '$app/stores'; import { clearAllParameters } from './tool.js'; import { env } from '$env/dynamic/public'; + import { estimatedDayReading } from '$lib/Media/manga.js'; export let user: AniListAuthorisation; @@ -351,7 +352,7 @@ Manga
- Time Read: {((chapters * 8.58) / 60 / 24).toFixed(2)} days + Time Read: {estimatedDayReading(chapters).toFixed(2)} days
Completed: {mangaList?.length} -- cgit v1.2.3