Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`(可加目录参数)。

### 输出文件

Expand Down
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions locales/en.js
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
1 change: 1 addition & 0 deletions locales/zh.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
noVideoFiles: '当前目录下未找到 .mp4 或 .mkv 视频文件。',
processingFile: ({ file }) => `正在处理:${file}`,
usingLocalFfprobe: '使用本地ffprobe',
usingLocalFfmpeg: '使用本地ffmpeg',
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dual-subtitle",
"version": "0.6.0",
"version": "0.6.1",
"main": "index.js",
"type": "module",
"bin": {
Expand Down