Skip to content

Commit

Permalink
Fix replay duplication in profile viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
Simyon264 committed May 7, 2024
1 parent 3681cf8 commit 82be943
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Server/Api/DataController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,14 @@ [FromQuery] string guid
{
return BadRequest("Invalid GUID");
}
var replays = await _context.Players

var replays = (await _context.Players
.Where(p => p.PlayerGuid == playerGuid)
.Include(p => p.Replay)
.Include(r => r.Replay.RoundEndPlayers)
.Select(p => p.Replay)
.ToListAsync();
.ToListAsync()
).DistinctBy(p => p.Id);

var charactersPlayed = new List<CharacterData>();
var totalPlaytime = TimeSpan.Zero;
Expand Down

0 comments on commit 82be943

Please sign in to comment.