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") }