diff options
| author | Fuwn <[email protected]> | 2024-11-18 16:21:16 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-11-18 16:21:16 -0800 |
| commit | 27b42641a681156748d8e46fe6ffe67204fb8d09 (patch) | |
| tree | 611f1373a508bc8ab307efa10e4ba76b84791dba /src | |
| parent | feat(user): add simple null check for remote user identity fetch (diff) | |
| download | due.moe-27b42641a681156748d8e46fe6ffe67204fb8d09.tar.xz due.moe-27b42641a681156748d8e46fe6ffe67204fb8d09.zip | |
feat(CleanMangaList): add total due episode count toggle function
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/List/Manga/CleanMangaList.svelte | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/List/Manga/CleanMangaList.svelte b/src/lib/List/Manga/CleanMangaList.svelte index dfaa187c..7b5b04b7 100644 --- a/src/lib/List/Manga/CleanMangaList.svelte +++ b/src/lib/List/Manga/CleanMangaList.svelte @@ -30,6 +30,13 @@ export let dummy = false; let serviceStatusResponse: Promise<Response>; + let totalEpisodeDueCount = media + .map((manga) => { + if (manga.mediaListEntry?.status === 'COMPLETED') return 0; + + return (manga.mediaListEntry?.progress || 0) - 1; + }) + .reduce((a, b) => a + b, 0); onMount(() => { serviceStatusResponse = fetch(proxy('https://api.mangadex.org/ping')); @@ -46,7 +53,7 @@ {#if authorised} <ListTitle - count={media.length} + count={$settings.displayTotalDueEpisodes && due ? totalEpisodeDueCount : media.length} time={endTime / 1000} title={due ? $locale().lists.due.mangaAndLightNovels |