diff --git a/Mundialito/Controllers/StatsController.cs b/Mundialito/Controllers/StatsController.cs index aa0260a..6c1d6b4 100644 --- a/Mundialito/Controllers/StatsController.cs +++ b/Mundialito/Controllers/StatsController.cs @@ -64,7 +64,7 @@ public async Task> GetStats(string username) private async Task> CalcStats(MundialitoUser requestedUser, MundialitoUser loggedUser, IEnumerable followees) { - var games = (float)gamesRepository.GetGames().Count(); + var games = (float)gamesRepository.GetGames().Where((game) => game.IsBetResolved()).Count(); var users = (float)userManager.Users.Count(); var bets = betsRepository.GetBets().Where((bet) => bet.IsResolved()).ToList(); var table = tableBuilder.GetTable(userManager.Users.Select((user) => new UserWithPointsModel(user)), bets, generalBetsRepository.GetGeneralBets()); diff --git a/Mundialito/DAL/Games/GameExtensionMethods.cs b/Mundialito/DAL/Games/GameExtensionMethods.cs index dfcdea6..a19b889 100644 --- a/Mundialito/DAL/Games/GameExtensionMethods.cs +++ b/Mundialito/DAL/Games/GameExtensionMethods.cs @@ -2,34 +2,34 @@ public static class GameExtensionMethods { - public static Boolean IsOpen(this Game game) + public static bool IsOpen(this Game game) { return game.IsOpen(DateTime.UtcNow); } - public static Boolean IsOpen(this Game game, DateTime now) + public static bool IsOpen(this Game game, DateTime now) { return now < game.CloseTime; } - public static Boolean IsPendingUpdate(this Game game) + public static bool IsPendingUpdate(this Game game) { return game.IsPendingUpdate(DateTime.UtcNow); } - public static Boolean IsPendingUpdate(this Game game, DateTime now) + public static bool IsPendingUpdate(this Game game, DateTime now) { if (game.IsOpen(now)) return false; return game.HomeScore == null || game.AwayScore == null || game.CardsMark == null || game.CornersMark == null; } - public static Boolean IsBetResolved(this Game game) + public static bool IsBetResolved(this Game game) { return game.IsBetResolved(DateTime.UtcNow); } - public static Boolean IsBetResolved(this Game game, DateTime now) + public static bool IsBetResolved(this Game game, DateTime now) { return !game.IsOpen(now) && !game.IsPendingUpdate(now); } @@ -40,7 +40,7 @@ public static String Mark(this Game game) return game.Mark(DateTime.UtcNow); } - public static String Mark(this Game game, DateTime now) + public static string Mark(this Game game, DateTime now) { if (!game.IsOpen(now)) {