From 7fc05993446392f5342815734a7a2e99cf63bddb Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 27 Aug 2023 17:22:40 -0700
Subject: feat: cache media

---
 src/lib/List/Due/AnimeList.svelte | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'src/lib/List/Due/AnimeList.svelte')

diff --git a/src/lib/List/Due/AnimeList.svelte b/src/lib/List/Due/AnimeList.svelte
index 4580cdf1..8527ed43 100644
--- a/src/lib/List/Due/AnimeList.svelte
+++ b/src/lib/List/Due/AnimeList.svelte
@@ -2,6 +2,8 @@
 	import { mediaListCollection, Type, flattenLists, type Media } from '$lib/AniList/media';
 	import type { UserIdentity, AniListAuthorisation } from '$lib/AniList/identity';
 	import { onMount } from 'svelte';
+	import anime from '../../../stores/anime';
+	import animeLastPrune from '../../../stores/mangaLastPrune';
 
 	export let user: AniListAuthorisation;
 	export let identity: UserIdentity;
@@ -13,7 +15,7 @@
 
 	onMount(async () => {
 		startTime = performance.now();
-		animeLists = mediaListCollection(user, identity, Type.Anime);
+		animeLists = mediaListCollection(user, identity, Type.Anime, $anime, $animeLastPrune);
 	});
 
 	const cleanMedia = (media: object[][], displayUnresolved: boolean) => {
@@ -104,7 +106,7 @@
 	};
 
 	const updateMedia = async (id: number, progress: number | undefined) => {
-		animeLists = mediaListCollection(user, identity, Type.Anime);
+		animeLists = mediaListCollection(user, identity, Type.Anime, $anime, $animeLastPrune);
 
 		await fetch(`/anilist/increment?id=${id}&progress=${progress! + 1}`);
 	};
-- 
cgit v1.2.3

