mirror of
https://github.com/HiMeditator/auto-caption.git
synced 2026-02-15 04:14:46 +08:00
feat(auto-caption): 发布 v0.7.0 版本
This commit is contained in:
@@ -61,6 +61,7 @@ class AllConfig {
|
||||
public readConfig() {
|
||||
const configPath = path.join(app.getPath('userData'), 'config.json')
|
||||
if(fs.existsSync(configPath)){
|
||||
Log.info('Read Config from:', configPath)
|
||||
const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'))
|
||||
if(config.captionWindowWidth) this.captionWindowWidth = config.captionWindowWidth
|
||||
if(config.uiLanguage) this.uiLanguage = config.uiLanguage
|
||||
@@ -69,7 +70,6 @@ class AllConfig {
|
||||
if(config.leftBarWidth) this.leftBarWidth = config.leftBarWidth
|
||||
if(config.styles) this.setStyles(config.styles)
|
||||
if(config.controls) this.setControls(config.controls)
|
||||
Log.info('Read Config from:', configPath)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -150,8 +150,7 @@ export class CaptionEngine {
|
||||
const lines = data.toString().split('\n')
|
||||
lines.forEach((line: string) => {
|
||||
if(line.trim()){
|
||||
controlWindow.sendErrorMessage(/*i18n('engine.error') +*/ line)
|
||||
console.error(line)
|
||||
Log.error(line)
|
||||
}
|
||||
})
|
||||
});
|
||||
@@ -228,6 +227,10 @@ function handleEngineData(data: any) {
|
||||
else if(data.command === 'info') {
|
||||
Log.info('Engine Info:', data.content)
|
||||
}
|
||||
else if(data.command === 'error') {
|
||||
Log.error('Engine Error:', data.content)
|
||||
controlWindow.sendErrorMessage(/*i18n('engine.error') +*/ data.content)
|
||||
}
|
||||
else if(data.command === 'usage') {
|
||||
Log.info('Engine Token Usage: ', data.content)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user