@@ -10,7 +10,9 @@ class FaqWikiUs implements Plugin.PluginBase {
1010 version = '3.0.1' ;
1111 icon = 'src/en/faqwikius/icon.png' ;
1212
13- parseNovels ( loadedCheerio : CheerioAPI , searchTerm ?: string ) {
13+ // Parses a list of NovelItem objects from already-loaded Cheerio HTML.
14+ // "List" clarifies it returns NovelItem[] (used by popularNovels and searchNovels).
15+ parseNovelList ( loadedCheerio : CheerioAPI , searchTerm ?: string ) {
1416 let novels : Plugin . NovelItem [ ] = [ ] ;
1517
1618 loadedCheerio ( '.plt-page-item' ) . each ( ( index , element ) => {
@@ -51,10 +53,12 @@ class FaqWikiUs implements Plugin.PluginBase {
5153 const body = await fetchApi ( this . site ) . then ( res => res . text ( ) ) ;
5254 const loadedCheerio = parseHTML ( body ) ;
5355
54- return this . parseNovels ( loadedCheerio ) ;
56+ return this . parseNovelList ( loadedCheerio ) ;
5557 }
5658
57- async parseNovel ( path : string ) : Promise < Plugin . SourceNovel > {
59+ // Fetches and parses a single novel's full details page (metadata, chapters, status).
60+ // "Details" distinguishes it from the list parser above.
61+ async parseNovelDetails ( path : string ) : Promise < Plugin . SourceNovel > {
5862 const body = await fetchApi ( this . site + path ) . then ( res => res . text ( ) ) ;
5963 const loadedCheerio = parseHTML ( body ) ;
6064 loadedCheerio ( 'script' ) . remove ( ) ;
@@ -182,7 +186,7 @@ class FaqWikiUs implements Plugin.PluginBase {
182186 const body = await fetchApi ( this . site ) . then ( res => res . text ( ) ) ;
183187 const loadedCheerio = parseHTML ( body ) ;
184188
185- return this . parseNovels ( loadedCheerio , searchTerm ) ;
189+ return this . parseNovelList ( loadedCheerio , searchTerm ) ;
186190 }
187191}
188192
0 commit comments