diff --git a/src/Logic/Web/LinkedDataLoader.ts b/src/Logic/Web/LinkedDataLoader.ts index 21a8ab650..16b3b0ee3 100644 --- a/src/Logic/Web/LinkedDataLoader.ts +++ b/src/Logic/Web/LinkedDataLoader.ts @@ -421,6 +421,7 @@ export default class LinkedDataLoader { delete output["chargeEnd"] delete output["chargeStart"] delete output["timeUnit"] + delete output["id"] asBoolean("covered") asBoolean("fee", true) @@ -800,14 +801,19 @@ export default class LinkedDataLoader { for (const unpatchedKey in unpatched) { // Dirty hack const rawData = await Utils.downloadJsonCached(url, 1000*60*60) - const images = rawData["photos"].map(ph => ph.image) - unpatched[unpatchedKey].images = new Set(images) + const images = rawData["photos"]?.map(ph => ph.image) + if(images){ + unpatched[unpatchedKey].images = new Set(images) + } } console.log("Got unpatched:", unpatched) const patched: Feature[] = [] - for (const section in unpatched) { + for (let section in unpatched) { const p = LinkedDataLoader.patchVeloparkProperties(unpatched[section]) + if(Object.keys(unpatched).length === 1 && section.endsWith("#section1")){ + section = section.split("#")[0] + } p["ref:velopark"] = [section] patched.push(LinkedDataLoader.asGeojson(p)) }