Merge pull request #1354 from Tony-sama/staging

Correct live2d model file parsing to handle non "model3" models
This commit is contained in:
Cohee 2023-11-14 00:29:43 +02:00 committed by GitHub
commit 4e9b952116
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ function registerEndpoints(app, jsonParser) {
//console.debug("FILE FOUND:",files)
for (let file of files) {
file = path.normalize(file.replace('public' + path.sep, ''));
if (file.endsWith("model3.json")) {
if (file.includes("model") && file.endsWith(".json")) {
//console.debug("Asset live2d model found:",file)
output[folder].push(path.normalize(path.join(file)));
}
@ -273,7 +273,7 @@ function registerEndpoints(app, jsonParser) {
if (fs.statSync(live2dModelPath).isDirectory()) {
for (let file of fs.readdirSync(live2dModelPath)) {
//console.debug("Character live2d model found:", file)
if (file.includes("model"))
if (file.includes("model") && file.endsWith(".json"))
output.push(path.join("characters", name, category, modelFolder, file));
}
}