Skip to content

Commit

Permalink
fix: fix match field of search result in internal search util
Browse files Browse the repository at this point in the history
  • Loading branch information
revam committed Oct 20, 2024
1 parent 3635a46 commit 34a3e4a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Shoko.Server/Utilities/SeriesSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public static SearchResult<T> DiceFuzzySearch<T>(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);

Expand All @@ -101,7 +102,7 @@ public static SearchResult<T> DiceFuzzySearch<T>(string text, string pattern, T
{
Distance = result,
LengthDifference = Math.Abs(pattern.Length - text.Length),
Match = text,
Match = match,
Result = value,
};
}
Expand Down

0 comments on commit 34a3e4a

Please sign in to comment.