Filter out invalid/broken characters
This commit is contained in:
parent
d81151efa2
commit
0873d3eaf9
|
@ -1360,6 +1360,12 @@ app.post("/getcharacters", jsonParser, function (request, response) {
|
||||||
let processingPromises = pngFiles.map((file, index) => processCharacter(file, index));
|
let processingPromises = pngFiles.map((file, index) => processCharacter(file, index));
|
||||||
await Promise.all(processingPromises); performance.mark('B');
|
await Promise.all(processingPromises); performance.mark('B');
|
||||||
|
|
||||||
|
// Filter out invalid/broken characters
|
||||||
|
characters = Object.values(characters).filter(x => x?.name).reduce((acc, val, index) => {
|
||||||
|
acc[index] = val;
|
||||||
|
return acc;
|
||||||
|
}, {});
|
||||||
|
|
||||||
response.send(JSON.stringify(characters));
|
response.send(JSON.stringify(characters));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue