diff --git a/FFBox Changelog.md b/FFBox Changelog.md index 3b0dc37..65598e6 100644 --- a/FFBox Changelog.md +++ b/FFBox Changelog.md @@ -1,5 +1,11 @@ # FFBox Changelog +# v2.6 + +- 增加了 macOS 系统的相关支持 +- 优化了“输出文件名”参数的相关功能 +--- +`2021-01-04` 修复“输出文件名”参数的识别的跨平台 bug,增加 Inputbox 的 placeholder `2020-12-22` 更新“输出文件名”参数的识别保留字并修改相关逻辑,少量优化浏览器启动支持性 `2020-12-20` macOS 相关更新:多选功能;参数控件的遍历方式优化 `2020-12-19` macOS 相关更新:字体、关闭窗口后退出 diff --git a/package.json b/package.json index e239482..bc5d355 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "main": "background.js", "dependencies": { "electron-store": "^5.2.0", + "upath": "^2.0.1", "vue": "^2.6.11", "vuex": "^3.4.0" }, diff --git a/src/App.vue b/src/App.vue index e83ffe5..8fd7170 100644 --- a/src/App.vue +++ b/src/App.vue @@ -14,7 +14,7 @@ import ContentWrapper from './App/ContentWrapper' import FloatingContent from './App/FloatingContent' import Vue from 'vue' import Vuex from 'vuex' -import path from 'path' // path 编译后可用于浏览器 +import upath from 'upath' let ElectronStore, electronStore, ipc, remote, currentWindow if (process.env.IS_ELECTRON) { @@ -80,7 +80,7 @@ const defaultParams = { output: { format: 'MP4', moveflags: false, - filename: '[filename]_converted.[fileext]' + filename: '[filedir]/[filebasename]_converted.[fileext]' } } @@ -641,7 +641,7 @@ const store = new Vuex.Store({ } // 更改到一些不匹配的值后会导致 getFFmpegParaArray 出错,但是修正代码就在后面,因此仅需忽略它,让它继续运行下去,不要急着更新 Vue.nextTick(() => { - Vue.set(state.globalParams, 'paraArray', getFFmpegParaArray('[输入文件名]', state.globalParams.input, state.globalParams.video, state.globalParams.audio, state.globalParams.output)) + Vue.set(state.globalParams, 'paraArray', getFFmpegParaArray('[输入目录]/[输入文件名].[输入扩展名]', state.globalParams.input, state.globalParams.video, state.globalParams.audio, state.globalParams.output)) // state.globalParams.paraArray = getFFmpegParaArray('[输入文件名]', state.globalParams.input, state.globalParams.video, state.globalParams.audio, state.globalParams.output) // state.globalParams = JSON.parse(JSON.stringify(state.globalParams)) @@ -679,7 +679,7 @@ const store = new Vuex.Store({ state.globalParams = Object.assign({}, defaultParams) } Vue.nextTick(() => { - Vue.set(state.globalParams, 'paraArray', getFFmpegParaArray('[输入文件名]', state.globalParams.input, state.globalParams.video, state.globalParams.audio, state.globalParams.output)) + Vue.set(state.globalParams, 'paraArray', getFFmpegParaArray('[输入目录]/[输入文件名].[输入扩展名]', state.globalParams.input, state.globalParams.video, state.globalParams.audio, state.globalParams.output)) }) }, // 添加任务(args:name, path, callback(传回添加后的 id)) @@ -862,7 +862,7 @@ export default { } }) // 更新全局参数输出 - this.$set(this.$store.state.globalParams, 'paraArray', getFFmpegParaArray('[输入文件名]', this.$store.state.globalParams.input, this.$store.state.globalParams.video, this.$store.state.globalParams.audio, this.$store.state.globalParams.output)) + this.$set(this.$store.state.globalParams, 'paraArray', getFFmpegParaArray('[输入目录]/[输入文件名].[输入扩展名]', this.$store.state.globalParams.input, this.$store.state.globalParams.video, this.$store.state.globalParams.audio, this.$store.state.globalParams.output)) if (process.env.IS_ELECTRON) { console.log('exe 路径:' + remote.app.getPath('exe')) @@ -922,7 +922,7 @@ function getFFmpegParaArray (filepath, iParams, vParams, aParams, oParams, withQ ret.push((withQuotes ? '"' : '') + filepath + (withQuotes ? '"' : '')) ret.push(...vGenerator.getVideoParam(vParams)) ret.push(...aGenerator.getAudioParam(aParams)) - ret.push(...fGenerator.getOutputParam(oParams, path.dirname(filepath), path.basename(filepath, path.extname(filepath)), withQuotes)) + ret.push(...fGenerator.getOutputParam(oParams, upath.dirname(filepath), upath.trimExt(upath.basename(filepath)), withQuotes)) ret.push('-y') return ret } diff --git a/src/App/Codecs/formats.js b/src/App/Codecs/formats.js index 550602c..970032e 100644 --- a/src/App/Codecs/formats.js +++ b/src/App/Codecs/formats.js @@ -141,7 +141,7 @@ const hwaccels = [ ] const generator = { - getOutputParam: function (outputParams, filedir, filename, withQuotes = false) { + getOutputParam: function (outputParams, filedir, filebasename, withQuotes = false) { var ret = [] if (outputParams.format != '无') { var format = formats.find((value) => { @@ -166,7 +166,7 @@ const generator = { } var outputFileName = outputParams.filename outputFileName = outputFileName.replace(/\[filedir\]/g, filedir) - outputFileName = outputFileName.replace(/\[filename\]/g, filename) + outputFileName = outputFileName.replace(/\[filebasename\]/g, filebasename) outputFileName = outputFileName.replace(/\[fileext\]/g, extension) if (withQuotes) { outputFileName = '"' + outputFileName + '"' diff --git a/src/App/ContentWrapper/Clientarea/Maincontent/Parabox/Components/Inputbox.vue b/src/App/ContentWrapper/Clientarea/Maincontent/Parabox/Components/Inputbox.vue index f8255c1..2f2071a 100644 --- a/src/App/ContentWrapper/Clientarea/Maincontent/Parabox/Components/Inputbox.vue +++ b/src/App/ContentWrapper/Clientarea/Maincontent/Parabox/Components/Inputbox.vue @@ -2,7 +2,7 @@