From de2b36787200608efb519d77c02db68e207164a1 Mon Sep 17 00:00:00 2001 From: Simon <63975668+Simyon264@users.noreply.github.com> Date: Fri, 22 Mar 2024 01:04:58 +0100 Subject: [PATCH] Hopefully increase performance + remove search limit --- Client/Components/Layout/MainLayout.razor | 24 ++++++++++++++++++++++- Client/Components/ReplayViewer.razor | 12 ------------ Server/Api/ReplayController.cs | 2 +- Shared/Constants.cs | 6 ++++++ 4 files changed, 30 insertions(+), 14 deletions(-) create mode 100644 Shared/Constants.cs diff --git a/Client/Components/Layout/MainLayout.razor b/Client/Components/Layout/MainLayout.razor index d3e6294..337e06c 100644 --- a/Client/Components/Layout/MainLayout.razor +++ b/Client/Components/Layout/MainLayout.razor @@ -13,4 +13,26 @@ An unhandled error has occurred. Reload 🗙 - \ No newline at end of file + + + \ No newline at end of file diff --git a/Client/Components/ReplayViewer.razor b/Client/Components/ReplayViewer.razor index 0bb5568..8e4aec7 100644 --- a/Client/Components/ReplayViewer.razor +++ b/Client/Components/ReplayViewer.razor @@ -96,18 +96,6 @@

Oops! This component is missing a replay. Please report this to the developers.

} - - @code { [Parameter] public Shared.Models.Replay? Replay { get; set; } diff --git a/Server/Api/ReplayController.cs b/Server/Api/ReplayController.cs index 6a4e64f..4d08305 100644 --- a/Server/Api/ReplayController.cs +++ b/Server/Api/ReplayController.cs @@ -86,7 +86,7 @@ [FromQuery] string query var found = ReplayParser.SearchReplays(searchMode, query, _context); // Order found replays by date - found = found.OrderByDescending(r => r.Date ?? DateTime.MinValue).Take(32 * 3).ToList(); + found = found.OrderByDescending(r => r.Date ?? DateTime.MinValue).Take(Constants.SearchLimit).ToList(); return Ok(found); } diff --git a/Shared/Constants.cs b/Shared/Constants.cs new file mode 100644 index 0000000..4cff739 --- /dev/null +++ b/Shared/Constants.cs @@ -0,0 +1,6 @@ +namespace Shared; + +public class Constants +{ + public const int SearchLimit = int.MaxValue; +} \ No newline at end of file