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"
This commit is contained in:
@@ -114,7 +114,7 @@ object StandingsHandler: PairgothApiHandler {
|
|||||||
"""
|
"""
|
||||||
; CL[${egfClass}]
|
; CL[${egfClass}]
|
||||||
; EV[${tournament.name}]
|
; EV[${tournament.name}]
|
||||||
; PC[${tournament.country.lowercase()},${tournament.location}]
|
; PC[${tournament.country.uppercase()},${tournament.location}]
|
||||||
; DT[${tournament.startDate},${tournament.endDate}]
|
; DT[${tournament.startDate},${tournament.endDate}]
|
||||||
; HA[${
|
; HA[${
|
||||||
if (tournament.pairing.type == PairingType.MAC_MAHON) "h${tournament.pairing.pairingParams.handicap.correction}"
|
if (tournament.pairing.type == PairingType.MAC_MAHON) "h${tournament.pairing.pairingParams.handicap.correction}"
|
||||||
@@ -123,7 +123,7 @@ object StandingsHandler: PairgothApiHandler {
|
|||||||
}]
|
}]
|
||||||
; KM[${tournament.komi}]
|
; KM[${tournament.komi}]
|
||||||
; TM[${tournament.timeSystem.adjustedTime() / 60}]
|
; 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(" ") }
|
; 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<Json.Object>, writer: PrintWriter) {
|
private fun exportToFFGFormat(tournament: Tournament<*>, lines: List<Json.Object>, writer: PrintWriter) {
|
||||||
val version = WebappManager.properties.getProperty("version")!!
|
val version = WebappManager.properties.getProperty("version")!!
|
||||||
|
val ffgName = "${ffgDate.format(tournament.startDate)}-${tournament.location.lowercase(Locale.ROOT).sanitizeISO()}"
|
||||||
val ret =
|
val ret =
|
||||||
""";name=${tournament.shortName}
|
""";name=$ffgName
|
||||||
;date=${frDate.format(tournament.startDate)}
|
;date=${frDate.format(tournament.startDate)}
|
||||||
;vill=${tournament.location}${if (tournament.online) "(online)" else ""}
|
;vill=${tournament.location}${if (tournament.online) "(online)" else ""}
|
||||||
;comm=${tournament.name}
|
;comm=${tournament.name}
|
||||||
;prog=Pairgoth v0.1
|
;prog=Pairgoth $version
|
||||||
;time=${tournament.timeSystem.mainTime / 60}
|
;time=${tournament.timeSystem.mainTime / 60}
|
||||||
;ta=${tournament.timeSystem.adjustedTime() / 60}
|
;ta=${tournament.timeSystem.adjustedTime() / 60}
|
||||||
;size=${tournament.gobanSize}
|
;size=${tournament.gobanSize}
|
||||||
@@ -264,4 +265,5 @@ ${
|
|||||||
|
|
||||||
private val numFormat = DecimalFormat("###0.#")
|
private val numFormat = DecimalFormat("###0.#")
|
||||||
private val frDate: DateTimeFormatter = DateTimeFormatter.ofPattern("dd/MM/yyyy")
|
private val frDate: DateTimeFormatter = DateTimeFormatter.ofPattern("dd/MM/yyyy")
|
||||||
|
private val ffgDate: DateTimeFormatter = DateTimeFormatter.ofPattern("yyMMdd")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user