UNPKG

rsshub

Version:
41 lines (39 loc) 1.13 kB
import "./dist-Bog6z_OM.mjs"; import "./config-MQ-7ebJ_.mjs"; import "./logger-C4avouvV.mjs"; import "./ofetch-DKl_Ma9g.mjs"; import "./is-worker-DESPicPc.mjs"; import "./cache-SV6W5EPy.mjs"; import "./helpers-Bo4JQYdN.mjs"; import "./got-CO-ndVl2.mjs"; import { n as getMangaDetails } from "./_feed-CEMFM3Vz.mjs"; //#region lib/routes/mangadex/index.ts const route = { path: "/manga/:id/:lang?", radar: [{ source: ["mangadex.org/title/:id/:suffix", "mangadex.org/title/:id"], target: "/manga/:id" }], name: "Single Manga Feed", maintainers: ["vzz64", "chrisis58"], example: "/mangadex/manga/f98660a1-d2e2-461c-960d-7bd13df8b76d/en", handler, features: { nsfw: true } }; async function handler(ctx) { const { id, lang } = ctx.req.param(); const mangaDetail = await getMangaDetails(id, lang); return { title: mangaDetail.title, link: `https://mangadex.org/title/${id}`, description: mangaDetail.description, item: mangaDetail.chapters.map((chapter) => ({ title: chapter.title, link: chapter.link, pubDate: chapter.pubDate, image: mangaDetail.cover })) }; } //#endregion export { route };