Skip to content

Commit e182f79

Browse files
committed
修复问题:输入输出剪辑输入框无法读取现有参数、无法正常为任务赋参数值;不能自动建立下载缓存目录;macOS/Linux 下系统进度条在任务完成后不重置
1 parent f903a3f commit e182f79

File tree

8 files changed

+26
-12
lines changed

8 files changed

+26
-12
lines changed

FFBox Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# FFBox Changelog
22

3+
`2022-06-22` 修复不能自动建立下载缓存目录的问题;修复 macOS/Linux 下系统进度条在任务完成后不重置的问题
4+
`2022-06-20` 解决输入输出剪辑输入框无法读取现有参数、无法正常为任务赋参数值的问题
35
`2022-06-01` 解决偶发性的无法打开软件主界面、转码成功但提示异常终止问题、修复 slider 和 checkbox 坐标
46
`2022-04-05` 完善 SpawnInvoker 的错误处理
57
`2022-04-04` 增加 SpawnInvoker 以解决 Windows 上 spawn 时出现 EPERM 的问题;新增 ffmpeg 异常终止事件监听

src/common/defaultParams.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export const defaultParams: OutputParams = {
55
mode: 'standalone',
66
hwaccel: '不使用',
77
files: [],
8+
begin: '',
9+
end: '',
810
},
911
video: {
1012
vcodec: 'HEVC',

src/common/utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,6 @@ export function replaceOutputParams(from: OutputParams, to: OutputParams) {
396396
}
397397
// 以下参数更改为任务原有的参数
398398
ret.input.mode = to.input.mode;
399-
ret.input.begin = to.input.begin;
400-
ret.input.end = to.input.end;
401399
ret.input.files = to.input.files;
402400
return ret;
403401
}

src/electron/components/floating/Msgbox/Msgbox.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ export default Vue.extend({
8989
let index = (this.buttons as Buttons).findIndex((button) => {
9090
return button.role === ButtonRole.Cancel;
9191
});
92-
if (index > 0) {
92+
if (index > -1) {
9393
this.close(index);
9494
}
9595
} else if (e.key === 'Enter') {
9696
let index = (this.buttons as Buttons).findIndex((button) => {
97-
return button.role === ButtonRole.Cancel;
97+
return button.role === ButtonRole.Confirm;
9898
});
99-
if (index > 0) {
99+
if (index > -1) {
100100
this.close(index);
101101
}
102102
}

src/electron/components/parabox/Inputbox.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default Vue.extend({
5858
}
5959
},
6060
watch: {
61-
text: function (newValue, oldValue) { // props 的 text 只有单向数据流,因此新增 data 的 inputText 做双向绑定和事件监听
61+
value: function (newValue, oldValue) { // props 的 text 只有单向数据流,因此新增 data 的 inputText 做双向绑定和事件监听
6262
this.inputText = newValue;
6363
},
6464
inputText: {

src/electron/containers/MainFrame/Titlebar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default Vue.extend<Data, any, any, any>({
7474
mode = 'none';
7575
break;
7676
}
77-
nodeBridge.remote?.getCurrentWindow().setProgressBar(this.workingStatusNProgress.progress * 0.99 + 0.01, {mode});
77+
nodeBridge.remote?.getCurrentWindow().setProgressBar(mode === 'none' ? -1 : this.workingStatusNProgress.progress * 0.99 + 0.01, {mode});
7878
return this.workingStatusNProgress.workingStatus ? this.workingStatusNProgress.progress * 100 + '%' : 0;
7979
},
8080
titleLeft: function () { // 暂停、运行状态下输出左侧,否则中间

src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ if (isDevelopment) {
162162
}
163163
})
164164
} else {
165+
app.disableHardwareAcceleration();
165166
process.on('SIGTERM', () => {
166167
win!.close();
167168
// app.quit()

src/service/uiBridge.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,26 @@ let wss: WebSocket.Server | null;
2020
let ffboxService: FFBoxService | null;
2121

2222
const uploadDir = os.tmpdir() + '/FFBoxUploadCache' // 文件上传目录
23+
const downloadDir = os.tmpdir() + '/FFBoxDownloadCache' // 文件下载目录
2324

2425
const uiBridge = {
2526
init(self: FFBoxService) {
2627
ffboxService = self;
27-
fs.access(uploadDir, fs.constants.F_OK, (err) => {
28-
if (err) {
29-
fs.mkdir(uploadDir, (err) => {
30-
console.log(getTimeString(new Date()), `创建缓存文件夹`, err);
31-
});
28+
const uploadDirCheck = new Promise((resolve) => {
29+
fs.access(uploadDir, fs.constants.F_OK, (err) => {
30+
return resolve(err ? false : true);
31+
});
32+
})
33+
const downloadDirCheck = new Promise((resolve) => {
34+
fs.access(downloadDir, fs.constants.F_OK, (err) => {
35+
return resolve(err ? false : true);
36+
});
37+
})
38+
Promise.all([uploadDirCheck, downloadDirCheck]).then((values) => {
39+
if (!values.every((value) => value)) {
40+
console.log(getTimeString(new Date()), `创建缓存文件夹`);
41+
fs.mkdir(uploadDir, () => {});
42+
fs.mkdir(downloadDir, () => {});
3243
}
3344
});
3445
},

0 commit comments

Comments
 (0)