OpenChargeMap: do not show addressInfo.relatedUrl if it is identical to operatorInfo.websiteUrl

This commit is contained in:
johan12345
2023-04-20 20:22:44 +02:00
parent fab66d1f84
commit 4a67ffd956

View File

@@ -75,11 +75,15 @@ data class OCMChargepoint(
operatorId?.toString(),
connections.map { "${it.connectionTypeId},${it.currentTypeId}" }),
operatorInfo?.websiteUrl,
addressInfo.relatedUrl,
if (operatorInfo?.websiteUrl?.withoutTrailingSlash() != addressInfo.relatedUrl?.withoutTrailingSlash()) addressInfo.relatedUrl else null,
Instant.now(),
isDetailed
)
private fun String.withoutTrailingSlash(): String {
return this.replace(Regex("/$"), "")
}
private fun convertFaultReport(): FaultReport? {
if (statusTypeId in faultStatuses || connections.any { it.statusTypeId in faultStatuses }) {
if (userComments != null) {