diff options
| author | Fuwn <[email protected]> | 2026-04-15 01:18:00 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-04-15 01:18:00 +0000 |
| commit | d06a7a9bb689849b2b7beced2606ceb98513f4bb (patch) | |
| tree | 8f54fc3fa12c70b21bf4bf421608c9b9400064da /src/lib/List/Manga | |
| parent | feat(command-palette): add clear anime and manga list caches action (diff) | |
| download | due.moe-d06a7a9bb689849b2b7beced2606ceb98513f4bb.tar.xz due.moe-d06a7a9bb689849b2b7beced2606ceb98513f4bb.zip | |
feat(cache): instant list revalidation from command palette and debug menu
Replaces one-shot boolean revalidateAnime with a counter store so
multiple components can subscribe without race conditions. Adds
revalidateManga store and reactive refresh blocks to DueAnimeList
and MangaListTemplate. Extracts shared invalidateListCaches function
used by both the command palette action and the debug settings button.
Renames palette item to "Refresh" and debug button to "Invalidate".
Diffstat (limited to 'src/lib/List/Manga')
| -rw-r--r-- | src/lib/List/Manga/MangaListTemplate.svelte | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/lib/List/Manga/MangaListTemplate.svelte b/src/lib/List/Manga/MangaListTemplate.svelte index 52649098..df894910 100644 --- a/src/lib/List/Manga/MangaListTemplate.svelte +++ b/src/lib/List/Manga/MangaListTemplate.svelte @@ -19,6 +19,7 @@ import identity from "$stores/identity"; import lastPruneTimes from "$stores/lastPruneTimes"; import locale from "$stores/locale"; import manga from "$stores/manga"; +import revalidateManga from "$stores/revalidateManga"; import settings from "$stores/settings"; import ListTitle from "../ListTitle.svelte"; import CleanMangaList from "./CleanMangaList.svelte"; @@ -141,6 +142,27 @@ $: if ( ) restartKeyCacher(Math.max($settings.cacheMangaMinutes, 5)); +let lastMangaRevalidation = 0; + +$: if (!dummy && $revalidateManga > lastMangaRevalidation) { + lastMangaRevalidation = $revalidateManga; + + startTime = performance.now(); + endTime = -1; + + mangaLists = mediaListCollection( + user, + $identity, + Type.Manga, + $manga, + $lastPruneTimes.manga, + { + forcePrune: true, + addNotification, + }, + ); +} + onDestroy(() => { if (keyCacher) clearInterval(keyCacher); }); |