tools_batch_files 1.0.24 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tools_batch_files",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "description": "批处理视频工具",
5
5
  "keywords": [
6
6
  "utils",
@@ -12,7 +12,8 @@
12
12
  "bin": {
13
13
  "tbf": "./index.js",
14
14
  "tbfp": "./src/photoBatch.js",
15
- "tbfb": "./src/photoBatchBack.js"
15
+ "tbfb": "./src/photoBatchBack.js",
16
+ "tbfre": "./src/removeFailVideo.js"
16
17
  },
17
18
  "scripts": {
18
19
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -3,13 +3,13 @@ const path = require("path");
3
3
 
4
4
  const workDir = process.cwd();
5
5
 
6
- const ORIGIN_FILE_DIR = "video";
6
+ const ORIGIN_FILE_DIR = "photos";
7
7
 
8
8
  // error错误日志目录
9
9
  const errorDir = path.join(workDir, "error.txt");
10
10
 
11
- const Error_Files_Dir = "failed_videos";
12
- // const Error_Files_Dir = "failed_photos";
11
+ // const Error_Files_Dir = "failed_videos";
12
+ const Error_Files_Dir = "failed_photos";
13
13
 
14
14
  /**
15
15
  * 确保目录存在,如果不存在则创建它
@@ -61,7 +61,8 @@ function findFileInDir(dir, fileName) {
61
61
  if (result) {
62
62
  return result;
63
63
  }
64
- } else if (file.startsWith(fileName) && file.endsWith(".mov")) {
64
+ // } else if (file.startsWith(fileName) && file.endsWith(".mov")) {
65
+ } else if (file.startsWith(fileName) && file.endsWith(".jpg")) {
65
66
  return { filePath, file };
66
67
  }
67
68
  }
@@ -90,7 +91,8 @@ txtData.forEach((item, index) => {
90
91
  const { filePath: originFilePath, file: fileName } = fileObj;
91
92
 
92
93
  if (originFilePath) {
93
- const failPath = path.join(workDir, Error_Files_Dir, fileName);
94
+ // const failPath = path.join(workDir, Error_Files_Dir, fileName);
95
+ const failPath = path.join("E:", Error_Files_Dir, fileName);
94
96
  // ensureDirSync(failPath)
95
97
 
96
98
  fs.copyFileSync(originFilePath, failPath);