+惊喜牌组

This commit is contained in:
辉鸭蛋
2024-10-11 02:56:49 +08:00
parent 7801ca2014
commit 212da5b0c2
2 changed files with 16 additions and 8 deletions

View File

@@ -36,9 +36,10 @@ function extractInfoFromJSFolder(folderPath) {
try {
const manifestContent = fs.readFileSync(manifestPath, 'utf8');
const manifest = JSON.parse(manifestContent);
const combinedDescription = `${manifest.name || ''}~|~${manifest.description || ''}`;
return {
version: manifest.version || '',
description: convertNewlines(manifest.description || ''),
description: convertNewlines(combinedDescription),
author: manifest.authors && manifest.authors.length > 0 ? manifest.authors[0].name : '',
tags: []
};
@@ -66,13 +67,13 @@ function extractInfoFromTCGFile(filePath, parentFolder) {
const descriptionMatch = content.match(/\/\/\s*描述:(.*)/);
const characterMatches = content.match(/角色\d+=([^|\r\n{]+)/g);
const tags = characterMatches
let tags = characterMatches
? characterMatches.map(match => match.split('=')[1].trim())
.filter(tag => tag && !tag.startsWith('角色'))
: [];
if (parentFolder === '惊喜牌组') {
tags.push('惊喜牌组');
if (filePath.includes('惊喜牌组')) {
tags = ['惊喜牌组', ...tags];
}
return {