diff options
| author | Fuwn <[email protected]> | 2024-06-15 03:16:13 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-06-15 03:16:13 -0700 |
| commit | 621cce4029e3fb519dc9a9dd2411fac7562a3d4c (patch) | |
| tree | 0686399074759003070b5b86adf3214154ae0726 /src/lib/List | |
| parent | fix(layout): ensure navigation is loaded (diff) | |
| download | due.moe-621cce4029e3fb519dc9a9dd2411fac7562a3d4c.tar.xz due.moe-621cce4029e3fb519dc9a9dd2411fac7562a3d4c.zip | |
feat(CleanAnimeList): total due episode count setting
Diffstat (limited to 'src/lib/List')
| -rw-r--r-- | src/lib/List/Anime/CleanAnimeList.svelte | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/lib/List/Anime/CleanAnimeList.svelte b/src/lib/List/Anime/CleanAnimeList.svelte index 3474f0b6..f9584659 100644 --- a/src/lib/List/Anime/CleanAnimeList.svelte +++ b/src/lib/List/Anime/CleanAnimeList.svelte @@ -30,6 +30,13 @@ export let dummy = false; let keyCacher: NodeJS.Timeout; + let totalEpisodeDueCount = media + .map((anime) => { + if (anime.mediaListEntry?.status === 'COMPLETED') return 0; + + return (anime.nextAiringEpisode?.episode || 1) - (anime.mediaListEntry?.progress || 0) - 1; + }) + .reduce((a, b) => a + b, 0); onMount(() => { if (dummy) return; @@ -91,7 +98,15 @@ }; </script> -<ListTitle time={endTime / 1000} count={media.length} {title} hideTime={dummy} hideCount={dummy} /> +<ListTitle + time={endTime / 1000} + count={$settings.displayTotalDueEpisodes && !notYetReleased && !completed && !upcoming + ? totalEpisodeDueCount + : media.length} + {title} + hideTime={dummy} + hideCount={dummy} +/> {#if media.length === 0} No anime to display. <button on:click={() => (animeLists = cleanCache(user, $identity))}> |