From 34a3e4abc856437d2e92c0b0c8310eee33d366ec Mon Sep 17 00:00:00 2001 From: Mikal Stordal Date: Sun, 20 Oct 2024 11:33:58 +0200 Subject: [PATCH] fix: fix match field of search result in internal search util --- Shoko.Server/Utilities/SeriesSearch.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Shoko.Server/Utilities/SeriesSearch.cs b/Shoko.Server/Utilities/SeriesSearch.cs index d1c1e1b1b..491ca9a68 100644 --- a/Shoko.Server/Utilities/SeriesSearch.cs +++ b/Shoko.Server/Utilities/SeriesSearch.cs @@ -85,6 +85,7 @@ public static SearchResult DiceFuzzySearch(string text, string pattern, T return new(); // Always search the longer string for the shorter one. + var match = text; if (pattern.Length > text.Length) (text, pattern) = (pattern, text); @@ -101,7 +102,7 @@ public static SearchResult DiceFuzzySearch(string text, string pattern, T { Distance = result, LengthDifference = Math.Abs(pattern.Length - text.Length), - Match = text, + Match = match, Result = value, }; }