From 5a4b538eec3348a5df0d166512e04f0bebdcc201 Mon Sep 17 00:00:00 2001
From: Batorian <lukas.richter.berlin@web.de>
Date: Sat, 1 Mar 2025 04:24:54 +0100
Subject: [PATCH 1/3] novel_updates: fix filter

---
 package.json                        |  2 +-
 src/plugins/english/novelupdates.ts | 66 ++++++++++++++++-------------
 2 files changed, 37 insertions(+), 31 deletions(-)

diff --git a/package.json b/package.json
index 6330496cf..3d39a4a74 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "lnreader-plugins",
-  "version": "3.0.0",
+  "version": "3.0.1",
   "description": "Plugins repo for LNReader",
   "main": "index.js",
   "type": "module",
diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts
index ec6b3ab6d..f32f0abbf 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.14';
+  version = '0.7.15';
   icon = 'src/en/novelupdates/icon.png';
   customCSS = 'src/en/novelupdates/customCSS.css';
   site = 'https://www.novelupdates.com/';
@@ -43,32 +43,23 @@ class NovelUpdates implements Plugin.PluginBase {
     }: Plugin.PopularNovelsOptions<typeof this.filters>,
   ): Promise<Plugin.NovelItem[]> {
     let link = `${this.site}`;
-    if (
-      filters?.language.value.length ||
-      filters?.novelType.value.length ||
-      filters?.genres.value.include?.length ||
-      filters?.genres.value.exclude?.length ||
-      filters?.reading_lists.value.length ||
-      filters?.storyStatus.value !== ''
+    if (showLatestNovels) {
+      link += 'series-finder/?sf=1&sort=sdate&order=desc';
+    } else if (
+      filters?.sort.value === 'popmonth' ||
+      filters?.sort.value === 'popular'
+    ) {
+      link += 'series-ranking/?rank=' + filters.sort.value;
+    } else if (
+      filters?.sort.value !== 'popmonth' &&
+      filters?.sort.value !== 'popular'
     ) {
       link += 'series-finder/?sf=1';
 
-      if (filters?.language.value.length) {
-        link += '&org=' + filters.language.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.exclude?.length) {
-        link += '&ge=' + filters.genres.value.exclude.join(',');
-      }
-
       if (
         filters?.genres.value.include?.length ||
         filters?.genres.value.exclude?.length
@@ -81,17 +72,30 @@ class NovelUpdates implements Plugin.PluginBase {
         link += '&mRLi=' + filters?.reading_list_operator.value;
       }
 
-      if (filters?.storyStatus.value.length) {
-        link += '&ss=' + filters.storyStatus.value;
-      }
-
       link += '&sort=' + filters?.sort.value;
 
       link += '&order=' + filters?.order.value;
-    } else if (showLatestNovels) {
-      link += 'latest-series/?st=1';
-    } else {
-      link += 'series-ranking/?rank=week';
+    } else if (
+      filters?.language.value.length ||
+      filters?.genres.value.include?.length ||
+      filters?.genres.value.exclude?.length ||
+      filters?.storyStatus.value !== ''
+    ) {
+      if (filters?.language.value.length) {
+        link += '&org=' + filters.language.value.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?.storyStatus.value.length) {
+        link += '&ss=' + filters.storyStatus.value;
+      }
     }
 
     link += '&pg=' + page;
@@ -1011,8 +1015,10 @@ class NovelUpdates implements Plugin.PluginBase {
   filters = {
     sort: {
       label: 'Sort Results By',
-      value: 'sdate',
+      value: 'popmonth',
       options: [
+        { label: 'Popular (Month)', value: 'popmonth' },
+        { label: 'Popular (All)', value: 'popular' },
         { label: 'Last Updated', value: 'sdate' },
         { label: 'Rating', value: 'srate' },
         { label: 'Rank', value: 'srank' },
@@ -1025,7 +1031,7 @@ class NovelUpdates implements Plugin.PluginBase {
       type: FilterTypes.Picker,
     },
     order: {
-      label: 'Order',
+      label: 'Order (Not for Popular)',
       value: 'desc',
       options: [
         { label: 'Descending', value: 'desc' },

From 8bc15c325e1e404eb67a63236a7b273f81131e40 Mon Sep 17 00:00:00 2001
From: Batorian <lukas.richter.berlin@web.de>
Date: Sat, 1 Mar 2025 04:31:18 +0100
Subject: [PATCH 2/3] novel_updates: fix filter

---
 src/plugins/english/novelupdates.ts | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts
index f32f0abbf..658684994 100644
--- a/src/plugins/english/novelupdates.ts
+++ b/src/plugins/english/novelupdates.ts
@@ -75,8 +75,9 @@ class NovelUpdates implements Plugin.PluginBase {
       link += '&sort=' + filters?.sort.value;
 
       link += '&order=' + filters?.order.value;
-    } else if (
-      filters?.language.value.length ||
+    }
+    if (
+      (!showLatestNovels && filters?.language.value.length) ||
       filters?.genres.value.include?.length ||
       filters?.genres.value.exclude?.length ||
       filters?.storyStatus.value !== ''

From 81e5ba853f38bcd1f741a8fad7b5d9ccfcb9689c Mon Sep 17 00:00:00 2001
From: Batorian <lukas.richter.berlin@web.de>
Date: Sat, 1 Mar 2025 04:44:26 +0100
Subject: [PATCH 3/3] novel_updates: rename filter

---
 package.json                        |  2 +-
 src/plugins/english/novelupdates.ts | 66 ++++++++++++++---------------
 2 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/package.json b/package.json
index 3d39a4a74..6330496cf 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "lnreader-plugins",
-  "version": "3.0.1",
+  "version": "3.0.0",
   "description": "Plugins repo for LNReader",
   "main": "index.js",
   "type": "module",
diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts
index 658684994..82eafb44c 100644
--- a/src/plugins/english/novelupdates.ts
+++ b/src/plugins/english/novelupdates.ts
@@ -56,10 +56,6 @@ class NovelUpdates implements Plugin.PluginBase {
     ) {
       link += 'series-finder/?sf=1';
 
-      if (filters?.novelType.value.length) {
-        link += '&nt=' + filters.novelType.value.join(',');
-      }
-
       if (
         filters?.genres.value.include?.length ||
         filters?.genres.value.exclude?.length
@@ -67,6 +63,10 @@ class NovelUpdates implements Plugin.PluginBase {
         link += '&mgi=' + filters.genre_operator.value;
       }
 
+      if (filters?.novelType.value.length) {
+        link += '&nt=' + filters.novelType.value.join(',');
+      }
+
       if (filters?.reading_lists.value.length) {
         link += '&hd=' + filters?.reading_lists.value.join(',');
         link += '&mRLi=' + filters?.reading_list_operator.value;
@@ -1051,34 +1051,8 @@ class NovelUpdates implements Plugin.PluginBase {
       ],
       type: FilterTypes.Picker,
     },
-    language: {
-      label: 'Language',
-      value: [],
-      options: [
-        { label: 'Chinese', value: '495' },
-        { label: 'Filipino', value: '9181' },
-        { label: 'Indonesian', value: '9179' },
-        { label: 'Japanese', value: '496' },
-        { label: 'Khmer', value: '18657' },
-        { label: 'Korean', value: '497' },
-        { label: 'Malaysian', value: '9183' },
-        { label: 'Thai', value: '9954' },
-        { label: 'Vietnamese', value: '9177' },
-      ],
-      type: FilterTypes.CheckboxGroup,
-    },
-    novelType: {
-      label: 'Novel Type',
-      value: [],
-      options: [
-        { label: 'Light Novel', value: '2443' },
-        { label: 'Published Novel', value: '26874' },
-        { label: 'Web Novel', value: '2444' },
-      ],
-      type: FilterTypes.CheckboxGroup,
-    },
     genre_operator: {
-      label: 'Genre (And/Or)',
+      label: 'Genre (And/Or) (Not for Popular)',
       value: 'and',
       options: [
         { label: 'And', value: 'and' },
@@ -1131,8 +1105,34 @@ class NovelUpdates implements Plugin.PluginBase {
         { label: 'Yuri', value: '922' },
       ],
     },
+    language: {
+      label: 'Language',
+      value: [],
+      options: [
+        { label: 'Chinese', value: '495' },
+        { label: 'Filipino', value: '9181' },
+        { label: 'Indonesian', value: '9179' },
+        { label: 'Japanese', value: '496' },
+        { label: 'Khmer', value: '18657' },
+        { label: 'Korean', value: '497' },
+        { label: 'Malaysian', value: '9183' },
+        { label: 'Thai', value: '9954' },
+        { label: 'Vietnamese', value: '9177' },
+      ],
+      type: FilterTypes.CheckboxGroup,
+    },
+    novelType: {
+      label: 'Novel Type (Not for Popular)',
+      value: [],
+      options: [
+        { label: 'Light Novel', value: '2443' },
+        { label: 'Published Novel', value: '26874' },
+        { label: 'Web Novel', value: '2444' },
+      ],
+      type: FilterTypes.CheckboxGroup,
+    },
     reading_list_operator: {
-      label: 'Reading List (Include/Exclude)',
+      label: 'Reading List (Include/Exclude) (Not for Popular)',
       value: 'include',
       options: [
         { label: 'Include', value: 'include' },
@@ -1141,7 +1141,7 @@ class NovelUpdates implements Plugin.PluginBase {
       type: FilterTypes.Picker,
     },
     reading_lists: {
-      label: 'Reading Lists',
+      label: 'Reading Lists (Not for Popular)',
       value: [],
       options: [{ label: 'All Reading Lists', value: '-1' }],
       type: FilterTypes.CheckboxGroup,
