From 69d68845171768dcc6371db7173a39596b9ab4d2 Mon Sep 17 00:00:00 2001 From: Glax Date: Mon, 26 Aug 2024 11:17:59 +0200 Subject: [PATCH] #227 Fix wrong filtering, only return top 10 results --- Tranga/MangaConnectors/Mangasee.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tranga/MangaConnectors/Mangasee.cs b/Tranga/MangaConnectors/Mangasee.cs index b10421c..1bc7445 100644 --- a/Tranga/MangaConnectors/Mangasee.cs +++ b/Tranga/MangaConnectors/Mangasee.cs @@ -62,7 +62,7 @@ public class Mangasee : MangaConnector } private readonly string[] _filterWords = {"a", "the", "of", "as", "to", "no", "for", "on", "with", "be", "and", "in", "wa", "at", "be", "ni"}; - private string ToFilteredString(string input) => string.Join(' ', input.ToLower().Split(' ').Where(word => _filterWords.Contains(word))); + private string ToFilteredString(string input) => string.Join(' ', input.ToLower().Split(' ').Where(word => _filterWords.Contains(word) == false)); private SearchResult[] FilteredResults(string publicationTitle, SearchResult[] unfilteredSearchResults) { Dictionary similarity = new(); @@ -81,7 +81,6 @@ public class Mangasee : MangaConnector } List ret = similarity.OrderBy(s => s.Value).Take(10).Select(s => s.Key).ToList(); - ret.AddRange(similarity.Where(s => s.Value < 5).Select(s => s.Key)); return ret.ToArray(); }