diff options
| author | Fuwn <[email protected]> | 2026-03-27 10:44:12 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-03-27 10:44:12 +0000 |
| commit | 12bfed974c77a85c8fb520682aae9cfeecbdf5b8 (patch) | |
| tree | d7cff80d7caa09f2a3d773577b61b5af539a554b /apps/proxy/src/index.js | |
| parent | style(ci): format and tidy proxy files (diff) | |
| download | due.moe-12bfed974c77a85c8fb520682aae9cfeecbdf5b8.tar.xz due.moe-12bfed974c77a85c8fb520682aae9cfeecbdf5b8.zip | |
fix(proxy): improve native manga chapter counts
Diffstat (limited to 'apps/proxy/src/index.js')
| -rw-r--r-- | apps/proxy/src/index.js | 17 |
1 files changed, 17 insertions, 0 deletions
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); |