aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-11-18 16:21:16 -0800
committerFuwn <[email protected]>2024-11-18 16:21:16 -0800
commit27b42641a681156748d8e46fe6ffe67204fb8d09 (patch)
tree611f1373a508bc8ab307efa10e4ba76b84791dba /src
parentfeat(user): add simple null check for remote user identity fetch (diff)
downloaddue.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.svelte9
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