repo/js/采集cd管理: 增加了跳过文件夹的功能 (#1806)

* new feature: skip folders that end with .disabled

* Updated readme and manifest.

* Update some comments

* Fix an issue where tasks unexpectedly stop
This commit is contained in:
Yihan Zhao
2025-09-04 04:22:26 +08:00
committed by GitHub
parent 71ba329c51
commit f3d5cb8590
3 changed files with 14 additions and 7 deletions

View File

@@ -15,5 +15,5 @@
- **配队管理**:支持为每个路径组指定配队名称,自动切换配队。
## 使用方法
1. 将要运行的地图追踪文件放在pathing文件夹下的不同路径组中将会按照路径组的顺序执行并跳过未刷新的路线
1. 将要运行的地图追踪文件放在pathing文件夹下的不同路径组中将会按照路径组的顺序执行并跳过未刷新的路线。可以在文件夹名称后面添加“.disabled”以禁用这个文件夹下的路径追踪文件。
2. 根据需要修改自定义配置设置操作模式、路径组CD类型、配队名称等参数。

View File

@@ -159,8 +159,11 @@ async function readFolder(folderPath, onlyJson) {
// 临时数组,用于存储子文件夹路径
const subFolders = [];
for (const filePath of filesInSubFolder) {
if (file.IsFolder(filePath)) {
// 如果是文件夹,先存储到临时数组中
if (file.IsFolder(filePath)) { // 如果是文件夹,先存储到临时数组中
if (filePath.toLowerCase().endsWith(".disabled")) { // 跳过以.disabled结尾的被禁用的路径
log.info(`跳过禁用的文件夹:${filePath}`);
continue;
}
subFolders.push(filePath);
} else {
// 如果是文件,根据 onlyJson 判断是否存储
@@ -236,10 +239,10 @@ async function readFolder(folderPath, onlyJson) {
const targetFolder = `pathing/路径组${i}`; // 动态生成目标文件夹路径
const files = await readFolder(targetFolder, true);
const filePaths = files.map(file => file.fullPath);
// 如果文件夹为空,退出循环
// 如果文件夹为空,跳过当前路径组
if (filePaths.length === 0) {
log.info(`路径组${i} 文件夹为空,停止处理`);
break;
log.info(`路径组${i} 文件夹为空,跳过`);
continue;
}
// 用于存储符合条件的文件名的数组
const jsonFileNames = [];

View File

@@ -1,13 +1,17 @@
{
"manifest_version": 1,
"name": "采集cd管理",
"version": "1.3.2",
"version": "1.3.3",
"bgi_version": "0.44.8",
"description": "仅面对会操作文件和读readme的用户基于文件夹操作自动管理采集路线的cd会按照路径组的顺序依次运行直到指定的时间并会按照给定的cd类型自动跳过未刷新的路线",
"authors": [
{
"name": "mno",
"links": "https://github.com/Bedrockx"
},
{
"name": "Juhao73692",
"links": "https://github.com/Juhao73692"
}
],
"settings_ui": "settings.json",