mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-05 13:28:08 +03:00
i accidentally the eslint
This commit is contained in:
@@ -18,83 +18,83 @@ program.parse(process.argv);
|
||||
const options = program.opts();
|
||||
|
||||
const dataset = JSON.parse(
|
||||
fs.readFileSync(path.join(__dirname, "./out.json"), "utf-8")
|
||||
fs.readFileSync(path.join(__dirname, "./out.json"), "utf-8")
|
||||
) as MDBJson[];
|
||||
|
||||
const logger = CreateLogCtx(__filename);
|
||||
|
||||
(async () => {
|
||||
for (const data of dataset) {
|
||||
for (const d in data.difficulties) {
|
||||
const diff = d as keyof typeof data.difficulties;
|
||||
for (const data of dataset) {
|
||||
for (const d in data.difficulties) {
|
||||
const diff = d as keyof typeof data.difficulties;
|
||||
|
||||
if (data.difficulties[diff] === 0) {
|
||||
logger.verbose(`Skipping chart ${data.title} ${diff}`);
|
||||
continue;
|
||||
}
|
||||
if (data.difficulties[diff] === 0) {
|
||||
logger.verbose(`Skipping chart ${data.title} ${diff}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
const spl = diff.split("-");
|
||||
const chart = (await db.charts.iidx.findOne({
|
||||
"data.inGameID": data.songID,
|
||||
playtype: spl[0] as Playtypes["iidx"],
|
||||
difficulty: spl[1] as Difficulties["iidx:SP" | "iidx:DP"],
|
||||
isPrimary: true,
|
||||
})) as ChartDocument<"iidx:SP" | "iidx:DP">;
|
||||
const spl = diff.split("-");
|
||||
const chart = (await db.charts.iidx.findOne({
|
||||
"data.inGameID": data.songID,
|
||||
playtype: spl[0] as Playtypes["iidx"],
|
||||
difficulty: spl[1] as Difficulties["iidx:SP" | "iidx:DP"],
|
||||
isPrimary: true,
|
||||
})) as ChartDocument<"iidx:SP" | "iidx:DP">;
|
||||
|
||||
if (!chart) {
|
||||
logger.warn(`No chart exists for ${data.title} (${diff}).`);
|
||||
continue;
|
||||
}
|
||||
if (!chart) {
|
||||
logger.warn(`No chart exists for ${data.title} (${diff}).`);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (chart.levelNum !== data.difficulties[diff]) {
|
||||
logger.warn(
|
||||
`Level Mismatch with ${data.title} (${diff}) [${chart.levelNum} -> ${data.difficulties[diff]}]`
|
||||
);
|
||||
if (chart.levelNum !== data.difficulties[diff]) {
|
||||
logger.warn(
|
||||
`Level Mismatch with ${data.title} (${diff}) [${chart.levelNum} -> ${data.difficulties[diff]}]`
|
||||
);
|
||||
|
||||
if (options.sync) {
|
||||
await db.charts.iidx.update(
|
||||
{
|
||||
_id: chart._id,
|
||||
},
|
||||
{
|
||||
$set: {
|
||||
levelNum: data.difficulties[diff],
|
||||
level: data.difficulties[diff].toString(),
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
if (options.sync) {
|
||||
await db.charts.iidx.update(
|
||||
{
|
||||
_id: chart._id,
|
||||
},
|
||||
{
|
||||
$set: {
|
||||
levelNum: data.difficulties[diff],
|
||||
level: data.difficulties[diff].toString(),
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (chart.data.notecount !== data.notecounts[diff]) {
|
||||
if (
|
||||
data.notecounts[diff] === undefined ||
|
||||
Math.abs(chart.data.notecount - data.notecounts[diff]!) > 2
|
||||
) {
|
||||
logger.error(
|
||||
`Significant Notecount Mismatch with ${data.title} (${diff}) [${chart.data.notecount} -> ${data.notecounts[diff]}] - skipping.`
|
||||
);
|
||||
// continue;
|
||||
}
|
||||
if (chart.data.notecount !== data.notecounts[diff]) {
|
||||
if (
|
||||
data.notecounts[diff] === undefined ||
|
||||
Math.abs(chart.data.notecount - data.notecounts[diff]!) > 2
|
||||
) {
|
||||
logger.error(
|
||||
`Significant Notecount Mismatch with ${data.title} (${diff}) [${chart.data.notecount} -> ${data.notecounts[diff]}] - skipping.`
|
||||
);
|
||||
// continue;
|
||||
}
|
||||
|
||||
logger.warn(
|
||||
`Notecount Mismatch with ${data.title} (${diff}) [${chart.data.notecount} -> ${data.notecounts[diff]}]`
|
||||
);
|
||||
logger.warn(
|
||||
`Notecount Mismatch with ${data.title} (${diff}) [${chart.data.notecount} -> ${data.notecounts[diff]}]`
|
||||
);
|
||||
|
||||
if (options.sync) {
|
||||
await db.charts.iidx.update(
|
||||
{
|
||||
_id: chart._id,
|
||||
},
|
||||
{
|
||||
$set: {
|
||||
"data.notecount": data.notecounts[diff],
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
logger.info("done");
|
||||
if (options.sync) {
|
||||
await db.charts.iidx.update(
|
||||
{
|
||||
_id: chart._id,
|
||||
},
|
||||
{
|
||||
$set: {
|
||||
"data.notecount": data.notecounts[diff],
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
logger.info("done");
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user