From 09c8e834f67d8fb43d53b912e51c956b25d4cb56 Mon Sep 17 00:00:00 2001 From: Claude Brisson Date: Sat, 29 Nov 2025 10:51:35 +0100 Subject: [PATCH] Fix FFG/EGF export format issues - FFG .tou name field: use AAMMJJ-ville format (2-digit year, hyphen, lowercase city without accents), e.g., "250830-marseille" - EGF .h country code: use uppercase PC[FR,...] instead of PC[fr,...] - Unify version numbers: use actual version from properties everywhere instead of hardcoded "v0.1" --- .../org/jeudego/pairgoth/api/StandingsHandler.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/StandingsHandler.kt b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/StandingsHandler.kt index 66110c6..ad1a757 100644 --- a/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/StandingsHandler.kt +++ b/api-webapp/src/main/kotlin/org/jeudego/pairgoth/api/StandingsHandler.kt @@ -114,7 +114,7 @@ object StandingsHandler: PairgothApiHandler { """ ; CL[${egfClass}] ; EV[${tournament.name}] -; PC[${tournament.country.lowercase()},${tournament.location}] +; PC[${tournament.country.uppercase()},${tournament.location}] ; DT[${tournament.startDate},${tournament.endDate}] ; HA[${ if (tournament.pairing.type == PairingType.MAC_MAHON) "h${tournament.pairing.pairingParams.handicap.correction}" @@ -123,7 +123,7 @@ object StandingsHandler: PairgothApiHandler { }] ; KM[${tournament.komi}] ; TM[${tournament.timeSystem.adjustedTime() / 60}] -; CM[Generated by Pairgoth v0.1] +; CM[Generated by Pairgoth ${WebappManager.properties.getProperty("version")}] ; ; Pl Name Rk Co Club ${ criteria.map { it.name.replace(Regex("(S?)O?(SOS|DOS)[MW]?"), "$1$2").padStart(7, ' ') }.joinToString(" ") } ${ @@ -173,12 +173,13 @@ ${ private fun exportToFFGFormat(tournament: Tournament<*>, lines: List, writer: PrintWriter) { val version = WebappManager.properties.getProperty("version")!! + val ffgName = "${ffgDate.format(tournament.startDate)}-${tournament.location.lowercase(Locale.ROOT).sanitizeISO()}" val ret = -""";name=${tournament.shortName} +""";name=$ffgName ;date=${frDate.format(tournament.startDate)} ;vill=${tournament.location}${if (tournament.online) "(online)" else ""} ;comm=${tournament.name} -;prog=Pairgoth v0.1 +;prog=Pairgoth $version ;time=${tournament.timeSystem.mainTime / 60} ;ta=${tournament.timeSystem.adjustedTime() / 60} ;size=${tournament.gobanSize} @@ -264,4 +265,5 @@ ${ private val numFormat = DecimalFormat("###0.#") private val frDate: DateTimeFormatter = DateTimeFormatter.ofPattern("dd/MM/yyyy") + private val ffgDate: DateTimeFormatter = DateTimeFormatter.ofPattern("yyMMdd") }