Feat: Implemented Series-Link

This commit is contained in:
Youwes09
2026-03-19 22:00:24 -05:00
parent b772b94c6c
commit 816b384d64
7 changed files with 311 additions and 249 deletions
+8 -6
View File
@@ -33,15 +33,18 @@
}
function fetchLibrary() {
return cache.get(CACHE_KEYS.LIBRARY, () =>
gql<{ mangas: { nodes: Manga[] } }>(GET_LIBRARY).then((d) => d.mangas.nodes)
return cache.get(
CACHE_KEYS.LIBRARY,
() => gql<{ mangas: { nodes: Manga[] } }>(GET_LIBRARY).then((d) => d.mangas.nodes),
DEFAULT_TTL_MS,
CACHE_GROUPS.LIBRARY,
);
}
function loadData() {
fetchLibrary()
.then((nodes) => {
allManga = dedupeMangaByTitle(dedupeMangaById(nodes));
allManga = dedupeMangaByTitle(dedupeMangaById(nodes), $settings.mangaLinks);
error = null;
})
.catch((e) => error = e.message)
@@ -52,7 +55,7 @@
DEFAULT_TTL_MS,
CACHE_GROUPS.LIBRARY,
).then((nodes) => {
allMangaUnfiltered = dedupeMangaByTitle(dedupeMangaById(nodes));
allMangaUnfiltered = dedupeMangaByTitle(dedupeMangaById(nodes), $settings.mangaLinks);
}).catch(console.error);
}
@@ -136,8 +139,7 @@
async function removeFromLibrary(manga: Manga) {
await gql(UPDATE_MANGA, { id: manga.id, inLibrary: false }).catch(console.error);
allManga = allManga.filter((m) => m.id !== manga.id);
cache.clear(CACHE_KEYS.LIBRARY);
cache.clearGroup(CACHE_GROUPS.LIBRARY);
cache.clearGroup(CACHE_GROUPS.LIBRARY); // clears "library" + "all_manga_unfiltered" + notifies subscribers
}
async function deleteAllDownloads(manga: Manga) {