diff --git a/ProjectLighthouse/Pages/SlotsPage.cshtml.cs b/ProjectLighthouse/Pages/SlotsPage.cshtml.cs index 2a87d653..5de0a35a 100644 --- a/ProjectLighthouse/Pages/SlotsPage.cshtml.cs +++ b/ProjectLighthouse/Pages/SlotsPage.cshtml.cs @@ -56,7 +56,11 @@ public class SlotsPage : BaseLayout this.SearchValue = name.Trim(); - this.SlotCount = await this.Database.Slots.CountAsync(p => p.Name.Contains(this.SearchValue)); + this.SlotCount = await this.Database.Slots.Include(p => p.Creator) + .Where(p => p.Name.Contains(finalSearch.ToString())) + .Where(p => p.Creator != null && (targetAuthor == null || string.Equals(p.Creator.Username.ToLower(), targetAuthor.ToLower()))) + .Where(p => targetGame == null || p.GameVersion == targetGame) + .CountAsync(); this.PageNumber = pageNumber; this.PageAmount = Math.Max(1, (int)Math.Ceiling((double)this.SlotCount / ServerStatics.PageSize)); @@ -72,8 +76,6 @@ public class SlotsPage : BaseLayout .Take(ServerStatics.PageSize) .ToListAsync(); - this.SlotCount = this.Slots.Count; - return this.Page(); } } \ No newline at end of file