diff options
| author | Fuwn <[email protected]> | 2023-12-06 00:23:21 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-12-06 00:23:21 -0800 |
| commit | a8ab5b5345d5fa3dbb3d865268b70955a7445022 (patch) | |
| tree | 5f81166d1b2a5251499fe3bcb1dfa28cef61d385 /src | |
| parent | fix(wrapped): no proxy on dev (diff) | |
| download | due.moe-a8ab5b5345d5fa3dbb3d865268b70955a7445022.tar.xz due.moe-a8ab5b5345d5fa3dbb3d865268b70955a7445022.zip | |
feat(manga): mal reading time
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/Media/manga.ts | 2 | ||||
| -rw-r--r-- | src/lib/Tools/Wrapped.svelte | 3 | ||||
| -rw-r--r-- | src/routes/user/[user]/+page.svelte | 3 |
3 files changed, 6 insertions, 2 deletions
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 @@ <b>Manga</b> </div> <div class="grid-item"> - Time Read: {((chapters * 8.58) / 60 / 24).toFixed(2)} days + Time Read: {estimatedDayReading(chapters).toFixed(2)} days </div> <div class="grid-item"> Completed: {mangaList?.length} diff --git a/src/routes/user/[user]/+page.svelte b/src/routes/user/[user]/+page.svelte index 858e6aec..171d4e5c 100644 --- a/src/routes/user/[user]/+page.svelte +++ b/src/routes/user/[user]/+page.svelte @@ -1,5 +1,6 @@ <script lang="ts"> import { user, type User } from '$lib/AniList/user'; + import { estimatedDayReading } from '$lib/Media/manga.js'; import { onMount } from 'svelte'; export let data; @@ -50,7 +51,7 @@ This user has watched {(userData.statistics.anime.minutesWatched / 60 / 24).toFixed(1)} days of anime and read - {((userData.statistics.manga.chaptersRead * 8.58) / 60 / 24).toFixed(1)} days of manga. + {estimatedDayReading(userData.statistics.manga.chaptersRead).toFixed(1)} days of manga. </div> </div> {/if} |