Skip to content

Commit

Permalink
FIX MangaFire : filter api junk (#6361)
Browse files Browse the repository at this point in the history
* FIX MangaFire : filter api junk

sometimes querying for Volumes returns Chapters.

* Update MangaFire.mjs
  • Loading branch information
MikeZeDev committed Oct 26, 2023
1 parent 258165d commit 28d84c7
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/web/mjs/connectors/MangaFire.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 28d84c7

Please sign in to comment.