diff options
| author | Fuwn <[email protected]> | 2026-04-14 18:19:54 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-04-14 18:19:54 -0700 |
| commit | f3ac4e6051d5b18c26d5a876ce12ddd1fd0f7107 (patch) | |
| tree | 8f54fc3fa12c70b21bf4bf421608c9b9400064da /src/lib/List/Anime/DueAnimeList.svelte | |
| parent | fix(ui): balance homepage media panels (diff) | |
| parent | feat(cache): instant list revalidation from command palette and debug menu (diff) | |
| download | due.moe-f3ac4e6051d5b18c26d5a876ce12ddd1fd0f7107.tar.xz due.moe-f3ac4e6051d5b18c26d5a876ce12ddd1fd0f7107.zip | |
Merge pull request #3 from Fuwn/feat/instant-cache-invalidation
feat(cache): instant list revalidation from command palette and debug menu
Diffstat (limited to 'src/lib/List/Anime/DueAnimeList.svelte')
| -rw-r--r-- | src/lib/List/Anime/DueAnimeList.svelte | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/lib/List/Anime/DueAnimeList.svelte b/src/lib/List/Anime/DueAnimeList.svelte index 2c707ffb..d2c47ebe 100644 --- a/src/lib/List/Anime/DueAnimeList.svelte +++ b/src/lib/List/Anime/DueAnimeList.svelte @@ -16,6 +16,7 @@ import { import { addNotification } from "$lib/Notification/store"; import locale from "$stores/locale"; import identity from "$stores/identity"; +import revalidateAnime from "$stores/revalidateAnime"; export let user: AniListAuthorisation; let animeLists: Promise<Media[]>; @@ -68,6 +69,27 @@ onMount(async () => { $: if (keyCacher && keyCacheMinutes !== $settings.cacheMinutes) restartKeyCacher($settings.cacheMinutes); +let lastAnimeRevalidation = 0; + +$: if ($revalidateAnime > lastAnimeRevalidation) { + lastAnimeRevalidation = $revalidateAnime; + + startTime = performance.now(); + endTime = -1; + + animeLists = mediaListCollection( + user, + $identity, + Type.Anime, + $anime, + $lastPruneTimes.anime, + { + forcePrune: true, + addNotification, + }, + ); +} + onDestroy(() => { if (keyCacher) clearInterval(keyCacher); }); |