Skip to content

Commit

Permalink
Update template with common chapter fetches
Browse files Browse the repository at this point in the history
Add common ways of getting chapter URLs to template
  • Loading branch information
dteviot committed Sep 11, 2023
1 parent d54c8fb commit 7aacf53
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions plugin/js/parsers/Template.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,26 @@ class TemplateParser extends Parser{
// to convert the links into a list of URLs the parser will collect.
let menu = dom.querySelector("div.su-tabs-panes");
return util.hyperlinksToChapterList(menu);
// Almost as common, find links on page and convert.
return [...dom.querySelectorAll("li.wp-manga-chapter.free-chap a")]
.map(a => util.hyperLinkToChapter(a));
// Need to walk multiple ToC pages, page by page
return (await this.walkTocPages(dom,
TemplateParser.chaptersFromDom,
TemplateParser.nextTocPageUrl,
chapterUrlsUI
));
// Can get list of all ToC pages
let tocPage1chapters = TemplateParser.extractPartialChapterList(dom);
let urlsOfTocPages = TemplateParser.getUrlsOfTocPages(dom);
return (await this.getChaptersFromAllTocPages(tocPage1chapters,
TemplateParser.extractPartialChapterList,
urlsOfTocPages,
chapterUrlsUI
));
}
*/

Expand Down

0 comments on commit 7aacf53

Please sign in to comment.