diff options
| author | Fuwn <[email protected]> | 2026-03-28 09:04:14 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-03-28 09:04:14 +0000 |
| commit | ebd08256f7c4b754e75eab02c110b689278e197f (patch) | |
| tree | d6a198ebeef943f58cf109ab7721a5a4b9769552 /src | |
| parent | fix(state): restore persisted list UI state (diff) | |
| download | due.moe-ebd08256f7c4b754e75eab02c110b689278e197f.tar.xz due.moe-ebd08256f7c4b754e75eab02c110b689278e197f.zip | |
fix(anilist): restore completed list query semantics
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/Data/AniList/cacheHydration.ts | 3 | ||||
| -rw-r--r-- | src/lib/Data/AniList/media.ts | 6 | ||||
| -rw-r--r-- | src/lib/List/Anime/CompletedAnimeList.svelte | 1 | ||||
| -rw-r--r-- | src/stores/anime.ts | 2 | ||||
| -rw-r--r-- | src/stores/manga.ts | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/Data/AniList/cacheHydration.ts b/src/lib/Data/AniList/cacheHydration.ts index 434d2a82..61cb1e60 100644 --- a/src/lib/Data/AniList/cacheHydration.ts +++ b/src/lib/Data/AniList/cacheHydration.ts @@ -5,6 +5,7 @@ import manga from "$stores/manga"; import localforage from "localforage"; type MediaCacheKind = "anime" | "manga"; +const cacheStorageKey = (kind: MediaCacheKind) => `${kind}:v3`; interface StoredLastPruneTimes { anime: number; @@ -32,7 +33,7 @@ export const hydrateMediaListCache = (kind: MediaCacheKind) => { const promise = (async () => { const [cache, pruneTimes] = await Promise.all([ - localforage.getItem<string>(kind), + localforage.getItem<string>(cacheStorageKey(kind)), localforage.getItem<StoredLastPruneTimes>("lastPruneTimes"), ]); diff --git a/src/lib/Data/AniList/media.ts b/src/lib/Data/AniList/media.ts index 211174e0..099d4182 100644 --- a/src/lib/Data/AniList/media.ts +++ b/src/lib/Data/AniList/media.ts @@ -212,7 +212,7 @@ interface CollectionOptions { const assignDefaultOptions = (options: CollectionOptions) => { const nonNullOptions: CollectionOptions = { - includeCompleted: true, + includeCompleted: false, forcePrune: false, all: false, addNotification: undefined, @@ -251,10 +251,10 @@ const collectionKey = ( }); const usesSharedMediaStore = (options: CollectionOptions) => - !!options.includeCompleted && !options.all && !options.includeRelations; + !options.includeCompleted && !options.all && !options.includeRelations; const cacheStorageKey = (type: Type, options: CollectionOptions) => { - const baseKey = type === Type.Anime ? "anime" : "manga"; + const baseKey = type === Type.Anime ? "anime:v3" : "manga:v3"; if (usesSharedMediaStore(options)) return baseKey; diff --git a/src/lib/List/Anime/CompletedAnimeList.svelte b/src/lib/List/Anime/CompletedAnimeList.svelte index ec9955b3..9c58a311 100644 --- a/src/lib/List/Anime/CompletedAnimeList.svelte +++ b/src/lib/List/Anime/CompletedAnimeList.svelte @@ -74,7 +74,6 @@ onMount(async () => { $anime, $lastPruneTimes.anime, { - includeCompleted: true, addNotification, }, ); diff --git a/src/stores/anime.ts b/src/stores/anime.ts index 0ab4513d..a82bfa55 100644 --- a/src/stores/anime.ts +++ b/src/stores/anime.ts @@ -1,5 +1,5 @@ import { persistentStore } from "$lib/Utility/persistentStore"; -const anime = persistentStore<string>("anime", ""); +const anime = persistentStore<string>("anime:v3", ""); export default anime; diff --git a/src/stores/manga.ts b/src/stores/manga.ts index e6637258..1d36e0e9 100644 --- a/src/stores/manga.ts +++ b/src/stores/manga.ts @@ -1,5 +1,5 @@ import { persistentStore } from "$lib/Utility/persistentStore"; -const manga = persistentStore<string>("manga", ""); +const manga = persistentStore<string>("manga:v3", ""); export default manga; |