diff --git a/src/Logic/Web/LinkedDataLoader.ts b/src/Logic/Web/LinkedDataLoader.ts index 6021c3061..c2eb21f69 100644 --- a/src/Logic/Web/LinkedDataLoader.ts +++ b/src/Logic/Web/LinkedDataLoader.ts @@ -371,6 +371,10 @@ export default class LinkedDataLoader { const match = maxstay.match(/P([0-9]+)D/) if (match) { const days = Number(match[1]) + if(days === 30){ + // 30 is the default which is set if velopark didn't know the actual value + return undefined + } if (days === 1) { return "1 day" } diff --git a/src/Logic/Web/VeloparkLoader.ts b/src/Logic/Web/VeloparkLoader.ts index 904f7ca25..dffaec485 100644 --- a/src/Logic/Web/VeloparkLoader.ts +++ b/src/Logic/Web/VeloparkLoader.ts @@ -17,7 +17,7 @@ export default class VeloparkLoader { private static readonly coder = new CountryCoder( Constants.countryCoderEndpoint, - Utils.downloadJson + Utils.downloadJson, ) public static convert(veloparkData: VeloparkData): Feature { @@ -46,14 +46,14 @@ export default class VeloparkLoader { if (veloparkData.contactPoint?.email) { properties["operator:email"] = VeloparkLoader.emailReformatting.reformat( - veloparkData.contactPoint?.email + veloparkData.contactPoint?.email, ) } if (veloparkData.contactPoint?.telephone) { properties["operator:phone"] = VeloparkLoader.phoneValidator.reformat( veloparkData.contactPoint?.telephone, - () => "be" + () => "be", ) } @@ -78,9 +78,12 @@ export default class VeloparkLoader { ) { const duration = g.maximumParkingDuration.substring( 1, - g.maximumParkingDuration.length - 1 + g.maximumParkingDuration.length - 1, ) - properties.maxstay = duration + " days" + if (duration !== "30") { + // We don't set maxstay if it is 30, they are the default value that velopark chose for "unknown" + properties.maxstay = duration + " days" + } } properties.access = g.publicAccess ?? "yes" ? "yes" : "no" const prefix = "http://schema.org/" @@ -94,11 +97,11 @@ export default class VeloparkLoader { const startHour = spec.opens const endHour = spec.closes === "23:59" ? "24:00" : spec.closes const merged = OH.MergeTimes( - OH.ParseRule(dayOfWeek + " " + startHour + "-" + endHour) + OH.ParseRule(dayOfWeek + " " + startHour + "-" + endHour), ) return OH.ToString(merged) }) - .join("; ") + .join("; "), ) properties.opening_hours = oh }