From 19c9ecb3e71ee6a08172a60aecfa73d9388e50ca Mon Sep 17 00:00:00 2001 From: glax Date: Sat, 14 Oct 2023 12:49:18 +0200 Subject: [PATCH] #66 Mangasee empty search breaks --- Tranga/MangaConnectors/Mangasee.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tranga/MangaConnectors/Mangasee.cs b/Tranga/MangaConnectors/Mangasee.cs index 22ae2ed..651a2ce 100644 --- a/Tranga/MangaConnectors/Mangasee.cs +++ b/Tranga/MangaConnectors/Mangasee.cs @@ -47,6 +47,11 @@ public class Mangasee : MangaConnector private Manga[] ParsePublicationsFromHtml(HtmlDocument document) { HtmlNode resultsNode = document.DocumentNode.SelectSingleNode("//div[@class='BoxBody']/div[last()]/div[1]/div"); + if (resultsNode.Descendants("div").Count() == 1 && resultsNode.Descendants("div").First().HasClass("NoResults")) + { + Log("No results."); + return Array.Empty(); + } Log($"{resultsNode.SelectNodes("div").Count} items."); HashSet ret = new();