From 3efa524bc779baa4f7b93e3bc28032a575a6437b Mon Sep 17 00:00:00 2001 From: Diego Date: Mon, 7 Aug 2023 12:46:52 -0300 Subject: [PATCH 1/2] Fix: allow the import of gpx files that use displayScale as Float xml node instead Double Fix the import of some gpx files that uses instead node on XProperties Example ```xml G2 26 -1 -1 -1 1.07818 ``` --- src/importer/GpifParser.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/importer/GpifParser.ts b/src/importer/GpifParser.ts index a6b223760..2f4de2794 100644 --- a/src/importer/GpifParser.ts +++ b/src/importer/GpifParser.ts @@ -1616,7 +1616,8 @@ export class GpifParser { const id: string = c.getAttribute('id'); switch (id) { case '1124139520': - bar.displayScale = parseFloat(c.findChildElement('Double')!.innerText); + const childNode = c.findChildElement('Double') ?? c.findChildElement('Float'); + bar.displayScale = parseFloat(childNode!.innerText); break; } break; From caadb1ef3ec3af4f1d114ea407fcbcfe6deff418 Mon Sep 17 00:00:00 2001 From: Diego Date: Wed, 26 Jun 2024 19:37:48 -0300 Subject: [PATCH 2/2] fix: Add support for non-mandatory tags in Section parse Adds support for xml Section parsing where sometimes some child tags may not exist, like in this example where only Text child tag is present ```xml
``` --- src/importer/GpifParser.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/importer/GpifParser.ts b/src/importer/GpifParser.ts index 2f4de2794..f3ee6c935 100644 --- a/src/importer/GpifParser.ts +++ b/src/importer/GpifParser.ts @@ -1162,8 +1162,8 @@ export class GpifParser { break; case 'Section': masterBar.section = new Section(); - masterBar.section.marker = c.findChildElement('Letter')!.innerText; - masterBar.section.text = c.findChildElement('Text')!.innerText; + masterBar.section.marker = c.findChildElement('Letter')?.innerText ?? ''; + masterBar.section.text = c.findChildElement('Text')?.innerText ?? ''; break; case 'Repeat': if (c.getAttribute('start').toLowerCase() === 'true') {