diff --git a/build/build.js b/build/build.js index 05b363af..45e59982 100644 --- a/build/build.js +++ b/build/build.js @@ -73,7 +73,7 @@ function extractInfoFromJSFolder(folderPath) { version: manifest.version || '', description: convertNewlines(combinedDescription), author: manifest.authors && manifest.authors.length > 0 ? manifest.authors[0].name : '', - tags: [] + tags: manifest.tags || [] }; } catch (error) { console.error(`解析 ${manifestPath} 时出错:`, error); @@ -105,10 +105,16 @@ function extractInfoFromPathingFile(filePath, parentFolders) { (getGitTimestamp(filePath) ? formatTime(getGitTimestamp(filePath)) : calculateSHA1(filePath).substring(0, 7)); + // 从父文件夹获取默认标签 let tags = parentFolders.slice(2) .filter(tag => !tag.includes('@')) .filter((tag, index, self) => self.indexOf(tag) === index); + // 如果存在自定义标签,与默认标签合并 + if (contentObj.info && contentObj.info.tags && Array.isArray(contentObj.info.tags)) { + tags = [...tags, ...contentObj.info.tags]; + } + if (contentObj.positions && Array.isArray(contentObj.positions)) { const actions = contentObj.positions.map(pos => pos.action); if (actions.includes('nahida_collect')) tags.push('纳西妲'); @@ -119,6 +125,9 @@ function extractInfoFromPathingFile(filePath, parentFolders) { if (actions.includes('fight')) tags.push('战斗'); } + // 确保标签数组中没有重复项 + tags = [...new Set(tags)]; + return { author: contentObj.info.author || '', description: convertNewlines(contentObj.info.description || ''), diff --git a/repo/js/稻妻合成台/manifest.json b/repo/js/稻妻合成台/manifest.json index 95208c38..29aea786 100644 --- a/repo/js/稻妻合成台/manifest.json +++ b/repo/js/稻妻合成台/manifest.json @@ -2,11 +2,12 @@ "manifest_version": 1, "name": "稻妻合成台", "version": "1.0", - "description": "去稻妻合成台“那位莱特不行,他冲刺比其他成男角色远”(成男角色冲刺右键8下,A左走5秒,跳跃找交互,停顿)", + "description": "去稻妻合成台 那位莱特不行,他冲刺比其他成男角色远(成男角色冲刺右键8下,A左走5秒,跳跃找交互,停顿)", "authors": [ { - "name": "fengbu", + "name": "fengbu" } ], + "tags": ["稻妻", "合成台"], "main": "main.js" } \ No newline at end of file diff --git a/repo/pathing/冰雾花(推荐胡桃)/冰雾花01-蒙德-坠星山谷-8个.json b/repo/pathing/冰雾花(推荐胡桃)/冰雾花01-蒙德-坠星山谷-8个.json index c0596d52..e3f219f0 100644 --- a/repo/pathing/冰雾花(推荐胡桃)/冰雾花01-蒙德-坠星山谷-8个.json +++ b/repo/pathing/冰雾花(推荐胡桃)/冰雾花01-蒙德-坠星山谷-8个.json @@ -5,7 +5,8 @@ "author": "Tool_tingsu", "version": "1.0", "description": "", - "bgiVersion": "0.42.3" + "bgiVersion": "0.42.3", + "tags": [ "胡桃"] }, "positions": [ {