Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ReplayBrowser/Helpers/ReplayHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ public static void CheckAccountAccess(Account? caller, Account? found)

var account = await _context.Accounts
.Include(a => a.Settings)
.FirstOrDefaultAsync(a => a.Username == username);
.FirstOrDefaultAsync(a => a.Guid == player.PlayerGuid);

if (account != null && account.Settings.RedactInformation && account.Guid != accountGuid)
{
Expand Down Expand Up @@ -405,6 +405,7 @@ public static void CheckAccountAccess(Account? caller, Account? found)
};
}

// Get total result count, cache it
// Technically it might be inaccurate. In practice nobody will care much?
int totalItems = _cache.GetOrCreate(cacheKey, e =>
{
Expand All @@ -413,7 +414,6 @@ public static void CheckAccountAccess(Account? caller, Account? found)
return queryable.Count();
});

// Get all results and store them in the cache
var allResults = queryable
.OrderByDescending(r => r.Date ?? DateTime.MinValue)
.Skip(page * pageSize)
Expand Down
Loading