From d4218b09162e81e40a5239e5b7b0760ca76a04ea Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Thu, 26 Oct 2023 18:00:34 +0000 Subject: [PATCH] FIX MangaFire : filter api junk (#6361) * FIX MangaFire : filter api junk sometimes querying for Volumes returns Chapters. * Update MangaFire.mjs --- src/web/mjs/connectors/MangaFire.mjs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/web/mjs/connectors/MangaFire.mjs b/src/web/mjs/connectors/MangaFire.mjs index c2aea2fc2c1..642396070d5 100644 --- a/src/web/mjs/connectors/MangaFire.mjs +++ b/src/web/mjs/connectors/MangaFire.mjs @@ -101,15 +101,16 @@ export default class MangaFire extends Connector { const data = await this.fetchJSON(request); const dom = this.createDOM(data.result.html); const chaptersNodes = [...dom.querySelectorAll('a')]; - chaptersNodes.map(chapter => { - const id = {itemid : chapter.dataset.id, itemtype : type}; - const title = chapter.text.trim(); - chapterList.push ({ - id : JSON.stringify(id), - title : title, - language : language + chaptersNodes.filter(anchor=> anchor.pathname.includes(`/${type}-`)) + .forEach(chapter => { + const id = {itemid : chapter.dataset.id, itemtype : type}; + const title = chapter.text.trim(); + chapterList.push ({ + id : JSON.stringify(id), + title : title, + language : language + }); }); - }); } } return chapterList;