Skip to content

Commit

Permalink
NewToki : Images filters (#5544)
Browse files Browse the repository at this point in the history
Fixes #5543
  • Loading branch information
MikeZeDev authored Mar 9, 2023
1 parent b443681 commit 885bd7e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/web/mjs/connectors/NewToki.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,15 @@ export default class NewToki extends GnuBoard5BootstrapBasic2 {
}
return mangaList;
}

async _getPages(chapter) {
//New toki show pages from others mangas in the chapter.
//Its easier to filter after template getPages occured
const chapid = chapter.id.match(/(comic|webtoon)\/([\d]+)/)[2];
const mangaid = chapter.manga.id.match(/(comic|webtoon)\/([\d]+)/)[2];
const path = `/${mangaid}/${chapid}/`; //makes sure image path matches chapter and manga
const images = await super._getPages(chapter);
return images.filter(image => image.includes(path));

}
}

0 comments on commit 885bd7e

Please sign in to comment.