From 3a8dbcdb3207176e9c86f7f28ffcfa60fe8e746e Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Tue, 28 Nov 2023 15:50:00 +0800 Subject: [PATCH] Disallow empty gallery list result It has to be a parse error --- app/src/main/rust/src/parser/list.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/rust/src/parser/list.rs b/app/src/main/rust/src/parser/list.rs index 18d83ec80..d1fa6add6 100644 --- a/app/src/main/rust/src/parser/list.rs +++ b/app/src/main/rust/src/parser/list.rs @@ -209,7 +209,7 @@ pub fn parseGalleryInfoList( if str.contains("

You do not have any watched tags") { panic!("No watched tags!") } - if str.contains("No hits found

") { + if str.contains("No hits found

") || str.contains("No unfiltered results found") { panic!("No hits found!") } let itg = get_vdom_first_element_by_class_name(dom, "itg")?; @@ -236,7 +236,7 @@ pub fn parseGalleryInfoList( .to_string(), ) }); - Some(GalleryListResult { + (!info.is_empty()).then_some(GalleryListResult { prev, next, galleryInfoList: info,