From 12bfed974c77a85c8fb520682aae9cfeecbdf5b8 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Fri, 27 Mar 2026 10:44:12 +0000 Subject: fix(proxy): improve native manga chapter counts --- apps/proxy/src/index.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'apps/proxy/src/index.js') diff --git a/apps/proxy/src/index.js b/apps/proxy/src/index.js index 80d87b1b..4f18ba44 100644 --- a/apps/proxy/src/index.js +++ b/apps/proxy/src/index.js @@ -1,4 +1,5 @@ import { bootstrapManga, syncMangadexIndex } from "./mangadex.js"; +import { fetchRawkumaChapterCounts } from "./rawkuma.js"; import { deleteMangadexFailureRows, getMangadexFailureRowsByAniListIds, @@ -271,6 +272,16 @@ const handleMangaChapterCounts = async (request, env, ctx) => { }); }; +const handleMangaNativeChapterCounts = async (request, env) => { + const manga = await parseMangaPayload(request); + + if (!manga.length) return jsonResponse(request, { data: {} }); + + return jsonResponse(request, { + data: await fetchRawkumaChapterCounts(env, request.headers, manga), + }); +}; + const isAuthorisedSyncRequest = (request, env) => { const token = env.MANGADEX_SYNC_TOKEN; @@ -305,6 +316,12 @@ export default { if (url.pathname === "/manga/chapter-counts" && request.method === "POST") return handleMangaChapterCounts(request, env, ctx); + if ( + url.pathname === "/manga/native-chapter-counts" && + request.method === "POST" + ) + return handleMangaNativeChapterCounts(request, env); + if (url.pathname === "/manga/sync" && request.method === "POST") return handleMangaSync(request, env); -- cgit v1.2.3