diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts index 167390092..73da31a9a 100644 --- a/src/plugins/english/novelupdates.ts +++ b/src/plugins/english/novelupdates.ts @@ -6,7 +6,7 @@ import { Plugin } from '@typings/plugin'; class NovelUpdates implements Plugin.PluginBase { id = 'novelupdates'; name = 'Novel Updates'; - version = '0.7.2'; + version = '0.7.3'; icon = 'src/en/novelupdates/icon.png'; customCSS = 'src/en/novelupdates/customCSS.css'; site = 'https://www.novelupdates.com/'; @@ -48,45 +48,59 @@ class NovelUpdates implements Plugin.PluginBase { filters?.novelType.value.length || filters?.genres.value.include?.length || filters?.genres.value.exclude?.length || + filters?.reading_lists.value.length || filters?.storyStatus.value !== '' ) { link += 'series-finder/?sf=1'; - } else if (showLatestNovels) { - link += 'latest-series/?st=1'; - } else { - link += 'series-ranking/?rank=week'; - } - if (filters?.language.value.length) - link += '&org=' + filters.language.value.join(','); + if (filters?.language.value.length) { + link += '&org=' + filters.language.value.join(','); + } - if (filters?.novelType.value.length) - link += '&nt=' + filters.novelType.value.join(','); + if (filters?.novelType.value.length) { + link += '&nt=' + filters.novelType.value.join(','); + } - if (filters?.genres.value.include?.length) - link += '&gi=' + filters.genres.value.include.join(','); + if (filters?.genres.value.include?.length) { + link += '&gi=' + filters.genres.value.include.join(','); + } - if (filters?.genres.value.exclude?.length) - link += '&ge=' + filters.genres.value.exclude.join(','); + if (filters?.genres.value.exclude?.length) { + link += '&ge=' + filters.genres.value.exclude.join(','); + } - if ( - filters?.genres.value.include?.length || - filters?.genres.value.exclude?.length - ) - link += '&mgi=' + filters.genre_operator.value; + if ( + filters?.genres.value.include?.length || + filters?.genres.value.exclude?.length + ) { + link += '&mgi=' + filters.genre_operator.value; + } - if (filters?.storyStatus.value.length) - link += '&ss=' + filters.storyStatus.value; + if (filters?.reading_lists.value.length) { + link += '&hd=' + filters?.reading_lists.value.join(','); + link += '&mRLi=' + filters?.reading_list_operator.value; + } + + if (filters?.storyStatus.value.length) { + link += '&ss=' + filters.storyStatus.value; + } - link += '&sort=' + filters?.sort.value; + link += '&sort=' + filters?.sort.value; - link += '&order=' + filters?.order.value; + link += '&order=' + filters?.order.value; + } else if (showLatestNovels) { + link += 'latest-series/?st=1'; + } else { + link += 'series-ranking/?rank=week'; + } link += '&pg=' + page; - const body = await fetchApi(link).then(result => result.text()); + const result = await fetchApi(link); + const body = await result.text(); const loadedCheerio = parseHTML(body); + return this.parseNovels(loadedCheerio); } @@ -551,6 +565,18 @@ class NovelUpdates implements Plugin.PluginBase { chapterText = `