feat: apply sieglinde to insane table

This commit is contained in:
zkldi
2022-08-21 13:45:32 +01:00
parent 08c9c7841e
commit 80fe0a96e1
2 changed files with 6676 additions and 6632 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,44 @@
const { Command } = require("commander");
const fs = require("fs");
const { MutateCollection } = require("../util");
const program = new Command();
program.option("-d, --data <out.json>");
program.parse(process.argv);
const options = program.opts();
if (!options.data) {
throw new Error(`Missing --data input.`);
}
const data = JSON.parse(fs.readFileSync(options.data));
MutateCollection("charts-bms.json", (charts) => {
const sglHashmap = new Map();
for (const d of data) {
sglHashmap[d.md5] = d;
}
for (const chart of charts) {
const maybeSgl = sglHashmap[chart.data.hashMD5];
if (maybeSgl) {
chart.tierlistInfo = {
"sgl-EC": {
individualDifference: false,
text: maybeSgl.ecStr,
value: maybeSgl.ec,
},
"sgl-HC": {
individualDifference: false,
text: maybeSgl.hcStr,
value: maybeSgl.hc,
},
};
}
}
return charts;
});