Skip to content

A full-featured download manager.

refactor: electron store sort config key

Dr_rOotc770108a6c5b
diff --git a/package.json b/package.json
index cd7efdc0..229493e5 100644
--- a/package.json
+++ b/package.json
@@ -205,8 +205,8 @@
"electron-devtools-installer": "^2.2.4",
"electron-notarize": "^0.0.5",
"electron-osx-sign": "^0.4.11",
- "electron-store": "^2.0.0",
"eslint": "^5.15.3",
+ "electron-store": "^3.2.0",
"eslint-config-standard": "^12.0.0",
"eslint-friendly-formatter": "^4.0.1",
"eslint-loader": "^2.1.2",
diff --git a/src/main/core/ConfigManager.js b/src/main/core/ConfigManager.js
index aec88851..7817f9b3 100644
--- a/src/main/core/ConfigManager.js
+++ b/src/main/core/ConfigManager.js
@@ -28,23 +28,21 @@ export default class ConfigManager {
this.systemConfig = new Store({
name: 'system',
defaults: {
- dir: getUserDownloadsPath(),
- // 断点续传
- continue: true,
- pause: true,
- split: 16,
- 'rpc-listen-port': 16800,
- 'rpc-secret': '',
- 'auto-file-renaming': true,
+ 'all-proxy': '',
'allow-overwrite': true,
+ 'auto-file-renaming': true,
+ 'continue': true,
+ 'dir': getUserDownloadsPath(),
'max-concurrent-downloads': 5,
- // macOS 版本修改过源码自己编译的,Linux 和 Windows 版本 暂未处理
'max-connection-per-server': is.macOS() ? 64 : 16,
- 'min-split-size': '1M',
- 'max-overall-download-limit': 0,
- 'max-overall-upload-limit': 0,
'max-download-limit': 0,
- 'all-proxy': '',
+ 'max-overall-download-limit': 0,
+ 'max-overall-upload-limit': '128K',
+ 'min-split-size': '1M',
+ 'pause': true,
+ 'rpc-listen-port': 16800,
+ 'rpc-secret': '',
+ 'split': 16,
'user-agent': 'Transmission/2.94'
}
})
@@ -54,20 +52,20 @@ export default class ConfigManager {
this.userConfig = new Store({
name: 'user',
defaults: {
- 'resume-all-when-app-launched': false,
- 'task-notification': true,
- 'hide-app-menu': is.windows() || is.linux(),
- 'new-task-show-downloading': true,
- 'auto-check-for-updates': false,
- 'update-channel': 'latest',
- 'use-proxy': false,
'all-proxy-backup': '',
+ 'auto-check-for-updates': false,
+ 'auto-check-update': false,
+ 'hide-app-menu': is.windows() || is.linux(),
+ 'last-check-update-time': 0,
+ 'locale': app.getLocale(),
'log-path': getLogPath(),
+ 'new-task-show-downloading': true,
+ 'resume-all-when-app-launched': false,
'session-path': getSessionPath(),
- 'locale': app.getLocale(),
+ 'task-notification': true,
'theme': 'auto',
- 'auto-check-update': false,
- 'last-check-update-time': 0
+ 'update-channel': 'latest',
+ 'use-proxy': false
}
})
}