Use newer API for Custom MDB, Fix profile bug.

This commit is contained in:
DitFranXX
2020-12-11 17:48:27 +09:00
parent 5d52767f0a
commit 8db9d98b2b
8 changed files with 117 additions and 77 deletions
+4 -5
View File
@@ -1,15 +1,14 @@
import * as path from "path";
import { readJSON, readXML } from './helper';
import { CommonMusicData, readJSONOrXML, readXML } from './helper';
export async function processData() {
const { music } = await readJSON(path.resolve(__dirname, './mdb_ex.json'))
const { music } = await readJSONOrXML('data/mdb_ex.json', 'data/mdb_ex.xml', processRawData)
return {
music,
};
}
export async function processRawData() {
const data = await readXML(path.resolve(__dirname, './mdb_ex.xml'))
export async function processRawData(path: string): Promise<CommonMusicData> {
const data = await readXML(path)
const mdb = $(data).elements("mdb.mdb_data");
const music: any[] = [];
for (const m of mdb) {