From fd9d1a95ab4c83fddff979281bc41f0ecfe77d1b Mon Sep 17 00:00:00 2001 From: asesidaa <1061472754@qq.com> Date: Mon, 19 Sep 2022 20:49:53 +0800 Subject: [PATCH] Fix clear, fc and pfc counts --- TaikoLocalServer/Controllers/Api/PlayDataController.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/TaikoLocalServer/Controllers/Api/PlayDataController.cs b/TaikoLocalServer/Controllers/Api/PlayDataController.cs index a780526..2931050 100644 --- a/TaikoLocalServer/Controllers/Api/PlayDataController.cs +++ b/TaikoLocalServer/Controllers/Api/PlayDataController.cs @@ -37,10 +37,9 @@ public class PlayDataController : BaseController var songPlayLogs = playLogs.Where(datum => datum.SongId == songBestData.SongId && datum.Difficulty == songBestData.Difficulty).ToList(); songBestData.PlayCount = songPlayLogs.Count; - var groups = songPlayLogs.GroupBy(datum => datum.Crown).ToLookup(datums => datums.Key); - songBestData.ClearCount = groups[CrownType.Clear].Count(); - songBestData.FullComboCount = groups[CrownType.Gold].Count(); - songBestData.PerfectCount = groups[CrownType.Dondaful].Count(); + songBestData.ClearCount = songPlayLogs.Count(datum => datum.Crown >= CrownType.Clear); + songBestData.FullComboCount = songPlayLogs.Count(datum => datum.Crown >= CrownType.Gold); + songBestData.PerfectCount = songPlayLogs.Count(datum => datum.Crown >= CrownType.Dondaful); } var favoriteSongs = await userDatumService.GetFavoriteSongIds(baid); var favoriteSet = favoriteSongs.ToHashSet();