Skip to content

Commit a3587f3

Browse files
committed
feat: update version to 2.10.1, enhance subtitle file handling, and adjust settings directory selection
1 parent 511e25b commit a3587f3

6 files changed

Lines changed: 9 additions & 9 deletions

File tree

electron-builder.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ win:
4646
linux:
4747
target:
4848
- AppImage
49-
- tar.gz
49+
# - tar.gz
5050
- deb
5151
category: AudioVideo
5252
artifactName: '${productName}_Linux_${version}_${arch}_${env.CUDA_VERSION}_${env.CUDA_OPT}.${ext}'

main/helpers/systemInfoManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export function setupSystemInfoManager(mainWindow: BrowserWindow) {
9898

9999
// 只删除 .wav 文件,保留目录结构
100100
for (const file of files) {
101-
if (file.endsWith('.wav')) {
101+
if (file.endsWith('.wav') || file.endsWith('.srt')) {
102102
const filePath = path.join(tempDir, file);
103103
await fse.unlink(filePath);
104104
logMessage(`Deleted cache file: ${filePath}`, 'info');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"private": true,
33
"name": "smartsub",
44
"description": "视频转字幕,字幕翻译软件",
5-
"version": "2.10.0",
5+
"version": "2.10.1",
66
"author": "buxuku <buxuku@gmail.com>",
77
"main": "app/background.js",
88
"scripts": {

renderer/pages/[locale]/home.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,18 @@ export default function Component() {
113113
? undefined
114114
: proofreadFile.filePath;
115115

116-
// 确定源字幕路径
116+
// 确定源字幕路径 - 优先使用目标目录的文件
117117
const sourceSubtitlePath =
118-
proofreadFile.tempSrtFile ||
119118
proofreadFile.srtFile ||
119+
proofreadFile.tempSrtFile ||
120120
(isSubtitleFile(proofreadFile.filePath)
121121
? proofreadFile.filePath
122122
: path.join(proofreadFile.directory, `${proofreadFile.fileName}.srt`));
123123

124-
// 确定翻译字幕路径(仅在需要翻译时)
124+
// 确定翻译字幕路径(仅在需要翻译时)- 优先使用目标目录的文件
125125
const targetSubtitlePath = isGenerateOnly
126126
? undefined
127-
: proofreadFile.tempTranslatedSrtFile || proofreadFile.translatedSrtFile;
127+
: proofreadFile.translatedSrtFile || proofreadFile.tempTranslatedSrtFile;
128128

129129
return {
130130
id: proofreadFile.uuid,

renderer/pages/[locale]/settings.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ const Settings = () => {
163163
const result = await window?.ipc?.invoke('selectDirectory');
164164
if (result.canceled) return;
165165

166-
const selectedPath = result.filePaths[0];
166+
const selectedPath = result.directoryPath;
167167
setModelsPath(selectedPath);
168168

169169
try {
@@ -179,7 +179,7 @@ const Settings = () => {
179179
const result = await window?.ipc?.invoke('selectDirectory');
180180
if (result.canceled) return;
181181

182-
const selectedPath = result.filePaths[0];
182+
const selectedPath = result.directoryPath;
183183
setCustomTempDir(selectedPath);
184184

185185
try {

resources/WechatIMG428.png

21.5 KB
Loading

0 commit comments

Comments
 (0)