Use wildcards in TVChaos UK search queries

The TVChaos UK search requires an exact match of the search string.
But it seems like they just send the unfiltered search to the SQL server in a like query (LIKE '%$searchstring%').
So we replace any whitespace/special character with % to make the search more usable.
This commit is contained in:
kaso17 2016-09-18 14:23:04 +02:00
parent 9c7ce468ee
commit 7d93361839
1 changed files with 6 additions and 0 deletions

View File

@ -194,6 +194,12 @@ namespace Jackett.Indexers
}
else
{
// The TVChaos UK search requires an exact match of the search string.
// But it seems like they just send the unfiltered search to the SQL server in a like query (LIKE '%$searchstring%').
// So we replace any whitespace/special character with % to make the search more usable.
Regex ReplaceRegex = new Regex("[^a-zA-Z0-9]+");
searchString = ReplaceRegex.Replace(searchString, "%");
var searchParams = new Dictionary<string, string> {
{ "do", "search" },
{ "keywords", searchString },