chore: optimise stats/view.php #816

Merged
Sainan merged 2 commits from optimise-view-stats into main 2025-01-18 16:58:59 -08:00
2 changed files with 1097 additions and 4363 deletions
Showing only changes of commit d56b2cf8ad - Show all commits

View File

@ -23,12 +23,16 @@ const viewController: RequestHandler = async (req, res) => {
});
}
if (config.unlockAllScans) {
responseJson.Scans = allScans;
const scans = new Set(allScans);
for (const type of Object.keys(ExportEnemies.avatars)) {
if (!responseJson.Scans.find(x => x.type == type)) {
responseJson.Scans.push({ type, scans: 9999 });
if (!scans.has(type)) {
scans.add(type);
}
}
responseJson.Scans = [];
for (const type of scans) {
responseJson.Scans.push({ type: type, scans: 9999 });
}
}
res.json(responseJson);
};

File diff suppressed because it is too large Load Diff