Use b64 as a data

This commit is contained in:
DitFranXX 2021-04-26 03:21:13 +09:00
parent 770ac0c66b
commit 3c941c3b3e
11 changed files with 40 additions and 23 deletions

View File

@ -6,10 +6,15 @@ Supported Versions
==================
- Matixx
- Exchain
- NEX+AGE (Work In Progress)
Release Notes
=============
v1.0.0 (Current)
v1.1.0 (Current)
----------------
* NEX+AGE Support (WIP)
v1.0.0
------
* Initial release for public

View File

@ -1,7 +1,7 @@
mdb_ex.xml
mdb_mt.xml
mdb_nt.xml
mdb_ex.b64
mdb_mt.b64
mdb.nt.b64
mdb_ex.json
mdb_mt.json
mdb_nt.json
custom_mdb.xml

View File

@ -1,10 +1,12 @@
import { CommonMusicData, readJSONOrXML, readXML } from './helper';
import { CommonMusicData, readJSONOrXML, readXML, readB64JSON } from './helper';
export async function processData() {
const { music } = await readJSONOrXML('data/mdb_ex.json', 'data/mdb_ex.xml', processRawData)
return {
music,
};
if (IO.Exists("data/mdb_ex.b64")) {
return await readB64JSON("data/mdb_ex.b64");
}
const data = await readJSONOrXML('data/mdb_nt.json', 'data/mdb_nt.xml', processRawData)
// await IO.WriteFile("data/mdb_ex.b64", Buffer.from(JSON.stringify(data)).toString("base64"))
return data
}
export async function processRawData(path: string): Promise<CommonMusicData> {

View File

@ -1,10 +1,12 @@
import { CommonMusicData, readJSONOrXML, readXML } from './helper';
import { CommonMusicData, readJSONOrXML, readXML, readB64JSON } from './helper';
export async function processData() {
const { music } = await readJSONOrXML('data/mdb_mt.json', 'data/mdb_mt.xml', processRawData)
return {
music,
};
if (IO.Exists("data/mdb_mt.b64")) {
return await readB64JSON("data/mdb_mt.b64");
}
const data = await readJSONOrXML('data/mdb_nt.json', 'data/mdb_nt.xml', processRawData)
// await IO.WriteFile("data/mdb_mt.b64", Buffer.from(JSON.stringify(data)).toString("base64"))
return data
}
export async function processRawData(path: string): Promise<CommonMusicData> {

View File

@ -1,10 +1,12 @@
import { CommonMusicData, readJSONOrXML, readXML } from './helper';
import { CommonMusicData, readJSONOrXML, readXML, readB64JSON } from './helper';
export async function processData() {
const { music } = await readJSONOrXML('data/mdb_nt.json', 'data/mdb_nt.xml', processRawData)
return {
music,
};
if (IO.Exists("data/mdb_nt.b64")) {
return await readB64JSON("data/mdb_nt.b64");
}
const data = await readJSONOrXML('data/mdb_nt.json', 'data/mdb_nt.xml', processRawData)
// await IO.WriteFile("data/mdb_nt.b64", Buffer.from(JSON.stringify(data)).toString("base64"))
return data
}
export async function processRawData(path: string): Promise<CommonMusicData> {

View File

@ -33,4 +33,9 @@ export async function readJSONOrXML(jsonPath: string, xmlPath: string, processHa
const json = JSON.parse(await IO.ReadFile(jsonPath, 'utf-8'))
return json
}
}
}
export async function readB64JSON(b64path: string) {
const buff = await IO.ReadFile(b64path, 'utf-8');
return JSON.parse(Buffer.from(buff, 'base64').toString('utf-8'));
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long