From 82be943d17725836deb93c35ff9507a70b47fc84 Mon Sep 17 00:00:00 2001 From: Simon <63975668+Simyon264@users.noreply.github.com> Date: Tue, 7 May 2024 21:55:01 +0200 Subject: [PATCH] Fix replay duplication in profile viewer --- Server/Api/DataController.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Server/Api/DataController.cs b/Server/Api/DataController.cs index 929f480..aa2ddd7 100644 --- a/Server/Api/DataController.cs +++ b/Server/Api/DataController.cs @@ -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(); var totalPlaytime = TimeSpan.Zero;