aboutsummaryrefslogtreecommitdiff
path: root/src/lib/AniList/media.ts
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-09-03 18:36:53 -0700
committerFuwn <[email protected]>2023-09-03 18:36:53 -0700
commit92293c66156e49f801fed6e8cc0996fd88f5f33b (patch)
tree155c66f6103987a88ddcde2af46ee7c79cc47177 /src/lib/AniList/media.ts
parentfix(media): cache minutes from settings (diff)
downloaddue.moe-92293c66156e49f801fed6e8cc0996fd88f5f33b.tar.xz
due.moe-92293c66156e49f801fed6e8cc0996fd88f5f33b.zip
feat(settings): move last prune times to store
Diffstat (limited to 'src/lib/AniList/media.ts')
-rw-r--r--src/lib/AniList/media.ts11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/AniList/media.ts b/src/lib/AniList/media.ts
index 034fccfd..ebf8c72f 100644
--- a/src/lib/AniList/media.ts
+++ b/src/lib/AniList/media.ts
@@ -2,9 +2,8 @@ import type { AniListAuthorisation } from '$lib/AniList/identity';
import type { UserIdentity } from './identity';
import anime from '../../stores/anime';
import manga from '../../stores/manga';
-import mangaLastPrune from '../../stores/mangaLastPrune';
-import animeLastPrune from '../../stores/animeLastPrune';
import settings from '../../stores/settings';
+import lastPruneTimes from '../../stores/lastPruneTimes';
export enum Type {
Anime,
@@ -69,9 +68,9 @@ export const mediaListCollection = async (
if (String(currentLastPruneAt) == '') {
if (type === Type.Anime) {
- animeLastPrune.set(new Date().getTime().toString());
+ lastPruneTimes.setKey('anime', new Date().getTime().toString());
} else {
- mangaLastPrune.set(new Date().getTime().toString());
+ lastPruneTimes.setKey('manga', new Date().getTime().toString());
}
} else {
if (
@@ -80,10 +79,10 @@ export const mediaListCollection = async (
forcePrune
) {
if (type === Type.Anime) {
- animeLastPrune.set(new Date().getTime().toString());
+ lastPruneTimes.setKey('anime', new Date().getTime().toString());
anime.set('');
} else {
- mangaLastPrune.set(new Date().getTime().toString());
+ lastPruneTimes.setKey('manga', new Date().getTime().toString());
manga.set('');
}