From 736f4c7cf2817f5086cf500ac6700f6d79c11bee Mon Sep 17 00:00:00 2001 From: Wayne Mao Date: Thu, 5 Feb 2026 00:49:06 +0800 Subject: [PATCH 1/2] fix: eng subtitle maybe empty but frames is larger than expected --- findSub.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/findSub.js b/findSub.js index 382c51c..2c3eb43 100644 --- a/findSub.js +++ b/findSub.js @@ -32,8 +32,8 @@ export const findSub = async (subTitles) => { } } - console.log('最终选择的简体中文字幕索引为:', chsSub.index); - console.log('最终选择的英语字幕索引为:', engSub.index); + console.log(`最终选择的简体中文字幕索引为:${chsSub.index},帧:${chsSub.frames}`); + console.log(`最终选择的英语字幕索引为:${engSub.index},帧:${chsSub.frames}`); console.log('时长:', chsSub.duration); return [chsSub, engSub]; @@ -107,7 +107,8 @@ const findChiSub = (subTitles) => { return targetSub ? { index: targetSub.index, - duration: targetSub.duration + duration: targetSub.duration, + frames: targetSub.frames } : null; } @@ -130,7 +131,7 @@ const findEngSub = (subTitles) => { const nonEmpty = englishSubs.filter(sub => { const frames = Number(sub.frames); if (!frames) return true; - return frames >= 10; + return frames >= 100; }); const candidatePool = nonEmpty.length > 0 ? nonEmpty : englishSubs; @@ -146,6 +147,7 @@ const findEngSub = (subTitles) => { return targetSub ? { index: targetSub.index, - duration: targetSub.duration + duration: targetSub.duration, + frames: targetSub.frames } : null; }; From d468cab2d2e4521f7ac78f6d482144893c5a3454 Mon Sep 17 00:00:00 2001 From: Wayne Mao Date: Thu, 5 Feb 2026 00:49:17 +0800 Subject: [PATCH 2/2] 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 39487d8..afe1ec1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dual-subtitle", - "version": "0.5.0", + "version": "0.5.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dual-subtitle", - "version": "0.5.0", + "version": "0.5.1", "license": "MIT", "dependencies": { "@ffmpeg-installer/ffmpeg": "^1.1.0", diff --git a/package.json b/package.json index 27d1fe3..80c2e3b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dual-subtitle", - "version": "0.5.0", + "version": "0.5.1", "main": "index.js", "type": "module", "bin": {