diff --git a/src/Api/Controllers/HttpUtilFunctions.cs b/src/Api/Controllers/HttpUtilFunctions.cs index e72117f5..737f8571 100644 --- a/src/Api/Controllers/HttpUtilFunctions.cs +++ b/src/Api/Controllers/HttpUtilFunctions.cs @@ -4,7 +4,7 @@ public static class HttpUtilFunctions { public static string? GetRealIpAddress(this HttpRequest httpRequest) { - var forwardedChain = httpRequest.HttpContext.Request.Headers["X-Forwarded-For"].First(); + var forwardedChain = httpRequest.HttpContext.Request.Headers["X-Forwarded-For"].FirstOrDefault(); if (string.IsNullOrEmpty(forwardedChain)) return httpRequest.HttpContext.Connection.RemoteIpAddress?.ToString(); var clientIp = forwardedChain.Split(',').First(); return clientIp; diff --git a/src/Application/Services/GemService.cs b/src/Application/Services/GemService.cs index 4642bab4..55fb1af7 100644 --- a/src/Application/Services/GemService.cs +++ b/src/Application/Services/GemService.cs @@ -68,18 +68,13 @@ private GemData[] FilterGemData(GemDataQuery query) private static string PreFilterGemDataQuery(GemDataQuery query) { - const string isAlternateQuality = """ - (LOWER("Name") LIKE 'anomalous%' - OR LOWER("Name") LIKE 'divergent%' - OR LOWER("Name") LIKE 'phantasmal%') - """; const string isVaal = """LOWER("Name") LIKE 'vaal%' """; const string isExceptional = """ - (LOWER("Name") LIKE '%enhance%' - OR LOWER("Name") LIKE '%empower%' - OR LOWER("Name") LIKE '%enlighten%') - """; + (LOWER("Name") LIKE '%enhance%' + OR LOWER("Name") LIKE '%empower%' + OR LOWER("Name") LIKE '%enlighten%') + """; const string isAwakened = """LOWER("Name") LIKE 'awakened%' """; const string isSupport = """LOWER("Name") LIKE '%support' """; var isGemTypeMatching = query.GemType switch @@ -93,12 +88,11 @@ OR LOWER("Name") LIKE '%enlighten%') }; return $""" - SELECT * FROM "GemData" - WHERE LOWER("Name") LIKE '%{query.SearchText}%' - AND ({query.ShowAlternateQuality} OR NOT {isAlternateQuality}) - AND ({query.ShowVaal} OR NOT {isVaal}) - AND {isGemTypeMatching} - """; + SELECT * FROM "GemData" + WHERE LOWER("Name") LIKE '%{query.SearchText}%' + AND ({query.ShowVaal} OR NOT {isVaal}) + AND {isGemTypeMatching} + """; } private static bool PostFilterGemData(GemData gemData, GemDataQuery query, decimal averageTempleCost) @@ -122,5 +116,6 @@ private static decimal OrderGemData(GemData gemData, Sort sort, decimal averageT }; } - [GeneratedRegex("[^a-z ]")] private static partial Regex SqlSanitizeRegex(); + [GeneratedRegex("[^a-z ]")] + private static partial Regex SqlSanitizeRegex(); } \ No newline at end of file diff --git a/src/Domain/QueryParameters/GemDataQuery.cs b/src/Domain/QueryParameters/GemDataQuery.cs index ca0a1e69..c4e1c48c 100644 --- a/src/Domain/QueryParameters/GemDataQuery.cs +++ b/src/Domain/QueryParameters/GemDataQuery.cs @@ -6,7 +6,6 @@ public class GemDataQuery public Sort Sort { get; init; } = Sort.AverageProfitPerTryDesc; public GemType GemType { get; init; } = GemType.All; public bool OnlyShowProfitable { get; init; } - public bool ShowAlternateQuality { get; init; } public bool ShowVaal { get; set; } = false; public decimal? PricePerTryFrom { get; set; } public decimal? PricePerTryTo { get; set; } diff --git a/src/Web/Shared/Components/Filter.razor b/src/Web/Shared/Components/Filter.razor index 50f757d3..1b27e1d9 100644 --- a/src/Web/Shared/Components/Filter.razor +++ b/src/Web/Shared/Components/Filter.razor @@ -99,13 +99,7 @@
-
- - -
-
+