aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-03-28 09:04:14 +0000
committerFuwn <[email protected]>2026-03-28 09:04:14 +0000
commitebd08256f7c4b754e75eab02c110b689278e197f (patch)
treed6a198ebeef943f58cf109ab7721a5a4b9769552 /src
parentfix(state): restore persisted list UI state (diff)
downloaddue.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.ts3
-rw-r--r--src/lib/Data/AniList/media.ts6
-rw-r--r--src/lib/List/Anime/CompletedAnimeList.svelte1
-rw-r--r--src/stores/anime.ts2
-rw-r--r--src/stores/manga.ts2
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;