mirror of
https://github.com/ev-map/EVMap.git
synced 2026-02-05 20:52:17 -05:00
OpenChargeMap: do not show addressInfo.relatedUrl if it is identical to operatorInfo.websiteUrl
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user