From d06a7a9bb689849b2b7beced2606ceb98513f4bb Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 15 Apr 2026 01:18:00 +0000 Subject: 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". --- src/lib/List/Manga/MangaListTemplate.svelte | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/lib/List/Manga') 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); }); -- cgit v1.2.3