diff options
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); |