mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Filter out invalid/broken characters
This commit is contained in:
@@ -1350,6 +1350,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));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user