This commit is contained in:
辉鸭蛋
2024-11-01 23:41:51 +08:00
parent fd5eb7cdcf
commit 67bb400422

View File

@@ -59,6 +59,30 @@ function extractInfoFromPathingFile(filePath, parentFolders) {
.map(tag => tag.split('@')[0]) // 取@符号前面的数据
.filter((tag, index, self) => self.indexOf(tag) === index); // 去重
// 检查positions数组中是否存在特定动作
if (content.positions && Array.isArray(content.positions)) {
const hasNahidaCollect = content.positions.some(pos => pos.action === 'nahida_collect');
const hasHydroCollect = content.positions.some(pos => pos.action === 'hydro_collect');
const hasAnemoCollect = content.positions.some(pos => pos.action === 'anemo_collect');
const hasElectroCollect = content.positions.some(pos => pos.action === 'electro_collect');
const hasUpDownGrabLeaf = content.positions.some(pos => pos.action === 'up_down_grab_leaf');
if (hasNahidaCollect) {
tags.push('纳西妲');
}
if (hasHydroCollect) {
tags.push('水元素力收集');
}
if (hasAnemoCollect) {
tags.push('风元素力收集');
}
if (hasElectroCollect) {
tags.push('雷元素力收集');
}
if (hasUpDownGrabLeaf) {
tags.push('四叶印');
}
}
return {
author: content.info && content.info.author ? content.info.author : '',
description: convertNewlines(content.info && content.info.description ? content.info.description : ''),