From 04a476c941dd9de85d66f5d32e8c2c0fb2b1fd7e Mon Sep 17 00:00:00 2001 From: Wayne Mao Date: Sun, 8 Feb 2026 21:01:52 +0800 Subject: [PATCH 1/3] fix: no video prompt --- index.js | 5 +++++ locales/en.js | 1 + locales/zh.js | 1 + 3 files changed, 7 insertions(+) diff --git a/index.js b/index.js index 1b37adc..e9f7550 100755 --- a/index.js +++ b/index.js @@ -12,6 +12,11 @@ import { t } from './i18n.js'; const main = async () => { const mediaFiles = fs.readdirSync(config.workdir).filter((file) => config.exts.includes(path.extname(file))); + if (mediaFiles.length === 0) { + console.log(t('noVideoFiles')); + return; + } + for (const file of mediaFiles) { console.log(t('processingFile', { file })); const subTitles = await analyzeMedia(file); diff --git a/locales/en.js b/locales/en.js index 7a1816e..492efca 100644 --- a/locales/en.js +++ b/locales/en.js @@ -1,4 +1,5 @@ export default { + noVideoFiles: 'No .mp4 or .mkv files found in the current directory.', processingFile: ({ file }) => `Processing: ${file}`, usingLocalFfprobe: 'Using local ffprobe', usingLocalFfmpeg: 'Using local ffmpeg', diff --git a/locales/zh.js b/locales/zh.js index 811bb5f..627ab09 100644 --- a/locales/zh.js +++ b/locales/zh.js @@ -1,4 +1,5 @@ export default { + noVideoFiles: '当前目录下未找到 .mp4 或 .mkv 视频文件。', processingFile: ({ file }) => `正在处理:${file}`, usingLocalFfprobe: '使用本地ffprobe', usingLocalFfmpeg: '使用本地ffmpeg', From 6007204f5dbd52428b41025765a3c76abd59ee5f Mon Sep 17 00:00:00 2001 From: Wayne Mao Date: Sun, 8 Feb 2026 21:02:35 +0800 Subject: [PATCH 2/3] fix: incorrect Synology system explanation --- README.md | 4 ++-- README.zh-CN.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 40c2d0f..40f7f03 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,8 @@ npx dual-subtitle npx dual-subtitle /path/to/videos ``` -> Without `npx` (e.g. some Synology setups): -> `node /path/to/dual-subtitle/index.js [directory]` +> If `npx` is not available (e.g. some Synology setups), use `npm exec` instead: +> `npm exec dual-subtitle` (optionally add a directory argument). ### Output diff --git a/README.zh-CN.md b/README.zh-CN.md index 25a304e..571188f 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -19,7 +19,7 @@ npx dual-subtitle npx dual-subtitle /path/to/videos ``` -> 若无 `npx`(如部分群晖环境),可用:`node /path/to/dual-subtitle/index.js [目录]` +> 注:有些环境(比如群晖)如果没有 `npx`,可以用 `npm exec` 代替,对应命令:`npm exec dual-subtitle`(可加目录参数)。 ### 输出文件 From 671c955dd46485640728d0c7fe05e7bb80c77f08 Mon Sep 17 00:00:00 2001 From: Wayne Mao Date: Sun, 8 Feb 2026 21:02:52 +0800 Subject: [PATCH 3/3] chore: bump version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fee7285..9ee10d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dual-subtitle", - "version": "0.6.0", + "version": "0.6.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dual-subtitle", - "version": "0.6.0", + "version": "0.6.1", "license": "MIT", "dependencies": { "@ffmpeg-installer/ffmpeg": "^1.1.0", diff --git a/package.json b/package.json index 6ad4548..8f3779a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dual-subtitle", - "version": "0.6.0", + "version": "0.6.1", "main": "index.js", "type": "module", "bin": {