Skip to content

Commit 82be943

Browse files
committed
Fix replay duplication in profile viewer
1 parent 3681cf8 commit 82be943

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Server/Api/DataController.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,14 @@ [FromQuery] string guid
116116
{
117117
return BadRequest("Invalid GUID");
118118
}
119-
120-
var replays = await _context.Players
119+
120+
var replays = (await _context.Players
121121
.Where(p => p.PlayerGuid == playerGuid)
122122
.Include(p => p.Replay)
123123
.Include(r => r.Replay.RoundEndPlayers)
124124
.Select(p => p.Replay)
125-
.ToListAsync();
125+
.ToListAsync()
126+
).DistinctBy(p => p.Id);
126127

127128
var charactersPlayed = new List<CharacterData>();
128129
var totalPlaytime = TimeSpan.Zero;

0 commit comments

Comments
 (0)