diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairable.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairable.kt index 3d5952e..85c9442 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairable.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/model/Pairable.kt @@ -106,7 +106,10 @@ fun Player.Companion.fromJson(json: Json.Object, default: Player? = null) = Play firstname = json.getString("firstname") ?: default?.firstname ?: badRequest("missing firstname"), rating = json.getInt("rating") ?: default?.rating ?: badRequest("missing rating"), rank = json.getInt("rank") ?: default?.rank ?: badRequest("missing rank"), - country = json.getString("country") ?: default?.country ?: badRequest("missing country"), + country = ( json.getString("country") ?: default?.country ?: badRequest("missing country") ).let { + // EGC uses UK, while FFG and browser language use GB + if (it == "UK") "GB" else it + }, club = json.getString("club") ?: default?.club ?: badRequest("missing club"), final = json.getBoolean("final") ?: default?.final ?: true, mmsCorrection = json.getInt("mmsCorrection") ?: default?.mmsCorrection ?: 0 diff --git a/view-webapp/src/main/kotlin/org/jeudego/pairgoth/ratings/EGFRatingsHandler.kt b/view-webapp/src/main/kotlin/org/jeudego/pairgoth/ratings/EGFRatingsHandler.kt index 75c5128..4532d73 100644 --- a/view-webapp/src/main/kotlin/org/jeudego/pairgoth/ratings/EGFRatingsHandler.kt +++ b/view-webapp/src/main/kotlin/org/jeudego/pairgoth/ratings/EGFRatingsHandler.kt @@ -23,6 +23,9 @@ object EGFRatingsHandler: RatingsHandler(RatingsManager.Ratings.EGF) { player["rating"]?.toString()?.toIntOrNull()?.let { rating -> player["rank"] = ((rating - 2050)/100).let { if (it < 0) "${-it+1}k" else "${it+1}d" } } + if ("UK" == player.getString("country")) { + player["country"] = "GB" + } } } }