From 734727c2af5b339f5c4041ebdfc4b151640b2db2 Mon Sep 17 00:00:00 2001 From: Claude Brisson Date: Sat, 13 Jul 2024 12:53:47 +0200 Subject: [PATCH] Do not count preliminary players in round stats --- .../src/main/kotlin/org/jeudego/pairgoth/model/Tournament.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Tournament.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Tournament.kt index 2ee8fa9..04551ec 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Tournament.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Tournament.kt @@ -143,7 +143,7 @@ sealed class Tournament ( fun stats() = (0..rounds - 1).map { index -> Json.Object( - "participants" to pairables.values.count { !it.skip.contains(index + 1) }, + "participants" to pairables.values.count { it.final && !it.skip.contains(index + 1) }, "paired" to (games.getOrNull(index)?.values?.flatMap { listOf(it.black, it.white) }?.count { it != 0 } ?: 0), "games" to (games.getOrNull(index)?.values?.count() ?: 0), "ready" to (games.getOrNull(index)?.values?.count { it.result != Game.Result.UNKNOWN } ?: 0)