From f501bab1642cee07b6d3893a2411f95087e9e3f7 Mon Sep 17 00:00:00 2001 From: Thome Valentin Date: Wed, 11 May 2022 17:06:03 +0200 Subject: [PATCH] Fixed bug preventing MDB files in XML format from loading correctly. --- gitadora@asphyxia/README.md | 6 +++++- gitadora@asphyxia/data/mdb/index.ts | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gitadora@asphyxia/README.md b/gitadora@asphyxia/README.md index 08f8f7c..2fede0c 100644 --- a/gitadora@asphyxia/README.md +++ b/gitadora@asphyxia/README.md @@ -1,6 +1,6 @@ GITADORA Plugin for Asphyxia-Core ================================= -![Version: v1.2.2](https://img.shields.io/badge/version-v1.2.2-blue) +![Version: v1.2.3](https://img.shields.io/badge/version-v1.2.3-blue) This plugin is based on converted from public-exported Asphyxia's Routes. @@ -31,6 +31,10 @@ Known Issues Release Notes ============= +v1.2.3 +---------------- + * Fixed bug preventing MDB files in XML format from loading (Thanks to DualEdge for reporting this ). + v1.2.2 ---------------- * Major improvements to the MDB (song data) loader. MDB files can now be in .json, .xml or .b64 format. This applies to both the per-version defaults and custom MDBs. To use a custom MDB, enable it in the web UI, and place a 'custom.xml', 'custom.json' or 'custom.b64' file in the data/mdb subfolder. diff --git a/gitadora@asphyxia/data/mdb/index.ts b/gitadora@asphyxia/data/mdb/index.ts index 9faf9f9..07de4be 100644 --- a/gitadora@asphyxia/data/mdb/index.ts +++ b/gitadora@asphyxia/data/mdb/index.ts @@ -17,7 +17,6 @@ type processRawDataHandler = (path: string) => Promise const logger = new Logger("mdb") export async function readXML(path: string) { - logger.debugInfo(`Loading MDB data from ${path}.`) const xml = await IO.ReadFile(path, 'utf-8'); const json = U.parseXML(xml, false) return json @@ -40,7 +39,7 @@ export async function readMDBFile(path: string, processHandler?: processRawDataH result = JSON.parse(str) break; case '.xml': - processHandler ?? defaultProcessRawXmlData + processHandler = processHandler ?? defaultProcessRawXmlData result = await processHandler(path) // Uncomment to save the loaded XML file as JSON. // await IO.WriteFile(path.replace(".xml", ".json"), JSON.stringify(data))