mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-29 02:18:09 +03:00
Finally synchronise everything and close #126
This commit is contained in:
@@ -67,20 +67,32 @@ const logger = CreateLogCtx("diff.ts");
|
||||
}
|
||||
|
||||
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]}]`
|
||||
);
|
||||
|
||||
await db.charts.iidx.update(
|
||||
{
|
||||
_id: chart._id,
|
||||
},
|
||||
{
|
||||
$set: {
|
||||
"data.notecount": data.notecounts[diff],
|
||||
if (options.sync) {
|
||||
await db.charts.iidx.update(
|
||||
{
|
||||
_id: chart._id,
|
||||
},
|
||||
}
|
||||
);
|
||||
{
|
||||
$set: {
|
||||
"data.notecount": data.notecounts[diff],
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user