mirror of
https://github.com/asphyxia-core/plugins.git
synced 2026-03-21 17:34:46 -05:00
Use b64 as a data
This commit is contained in:
parent
770ac0c66b
commit
3c941c3b3e
|
|
@ -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
|
||||
6
gitadora@asphyxia/data/.gitignore
vendored
6
gitadora@asphyxia/data/.gitignore
vendored
|
|
@ -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
|
||||
|
|
@ -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> {
|
||||
|
|
|
|||
|
|
@ -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> {
|
||||
|
|
|
|||
|
|
@ -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> {
|
||||
|
|
|
|||
|
|
@ -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'));
|
||||
}
|
||||
|
|
|
|||
1
gitadora@asphyxia/data/mdb_ex.b64
Normal file
1
gitadora@asphyxia/data/mdb_ex.b64
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
gitadora@asphyxia/data/mdb_mt.b64
Normal file
1
gitadora@asphyxia/data/mdb_mt.b64
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
gitadora@asphyxia/data/mdb_nt.b64
Normal file
1
gitadora@asphyxia/data/mdb_nt.b64
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user