mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-24 08:21:37 +01:00
Filter out invalid character files
This commit is contained in:
parent
59657766b5
commit
10aa268ea2
@ -876,7 +876,7 @@ router.post('/all', jsonParser, async function (request, response) {
|
||||
const files = fs.readdirSync(request.user.directories.characters);
|
||||
const pngFiles = files.filter(file => file.endsWith('.png'));
|
||||
const processingPromises = pngFiles.map(file => processCharacter(file, request.user.directories));
|
||||
const data = await Promise.all(processingPromises);
|
||||
const data = (await Promise.all(processingPromises)).filter(c => c.name);
|
||||
return response.send(data);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
|
Loading…
Reference in New Issue
Block a user