Skip to content

A full-featured download manager.

refactor: bt auto download content

Dr_rOotb01d43cf73bd
diff --git a/src/main/core/ConfigManager.js b/src/main/core/ConfigManager.js
index 16206fe9..c5811413 100644
--- a/src/main/core/ConfigManager.js
+++ b/src/main/core/ConfigManager.js
@@ -71,6 +71,7 @@ export default class ConfigManager {
'min-split-size': '1M',
'no-proxy': EMPTY_STRING,
'pause': true,
+ 'pause-metadata': false,
'rpc-listen-port': 16800,
'rpc-secret': EMPTY_STRING,
'seed-ratio': 1,
diff --git a/src/renderer/components/Preference/Basic.vue b/src/renderer/components/Preference/Basic.vue
index 2581bbe4..2dc44217 100644
--- a/src/renderer/components/Preference/Basic.vue
+++ b/src/renderer/components/Preference/Basic.vue
@@ -152,6 +152,13 @@
{{ $t('preferences.bt-save-metadata') }}
</el-checkbox>
</el-col>
+ <el-col class="form-item-sub" :span="24">
+ <el-checkbox
+ v-model="form.btAutoDownloadContent"
+ >
+ {{ $t('preferences.bt-auto-download-content') }}
+ </el-checkbox>
+ </el-col>
<el-col class="form-item-sub" :span="24">
<el-switch
v-model="form.keepSeeding"
@@ -183,22 +190,6 @@
:label="$t('preferences.seed-time')">
</el-input-number>
</el-col>
- <el-col class="form-item-sub" :span="24">
- <el-switch
- v-model="form.followMetalink"
- :active-text="$t('preferences.follow-metalink')"
- >
- </el-switch>
- </el-col>
- <el-col class="form-item-sub" :span="24">
- <el-switch
- v-model="form.followTorrent"
- :active-text="$t('preferences.follow-torrent')"
- >
- </el-switch>
- </el-col>
- <div class="el-form-item__info" style="margin-top: 8px;">
- </div>
</el-form-item>
<el-form-item
:label="`${$t('preferences.task-manage')}: `"
@@ -285,8 +276,6 @@
btSaveMetadata,
dir,
engineMaxConnectionPerServer,
- followMetalink,
- followTorrent,
hideAppMenu,
keepSeeding,
keepWindowState,
@@ -298,6 +287,7 @@
newTaskShowDownloading,
noConfirmBeforeDeleteTask,
openAtLogin,
+ pauseMetadata,
resumeAllWhenAppLaunched,
runMode,
seedRatio,
@@ -308,12 +298,11 @@
} = config
const result = {
autoHideWindow,
+ btAutoDownloadContent: !pauseMetadata,
btSaveMetadata,
continue: config.continue,
dir,
engineMaxConnectionPerServer,
- followMetalink,
- followTorrent,
hideAppMenu,
keepSeeding,
keepWindowState,
@@ -487,11 +476,16 @@
return false
}
- const { runMode, openAtLogin, autoHideWindow } = this.form
+ const { btAutoDownloadContent, runMode, openAtLogin, autoHideWindow } = this.form
const changed = diffConfig(this.formOriginal, this.form)
const data = {
...changed
}
+ if ('btAutoDownloadContent' in changed) {
+ data.pauseMetadata = !btAutoDownloadContent
+ data.followMetalink = btAutoDownloadContent
+ data.followTorrent = btAutoDownloadContent
+ }
console.log('[Motrix] preference changed data:', data)
this.$store.dispatch('preference/save', data)
diff --git a/src/renderer/utils/task.js b/src/renderer/utils/task.js
index c7a21027..038d511f 100644
--- a/src/renderer/utils/task.js
+++ b/src/renderer/utils/task.js
@@ -14,8 +14,6 @@ export const initTaskForm = state => {
allProxy,
dir,
engineMaxConnectionPerServer,
- followMetalink,
- followTorrent,
maxConnectionPerServer,
newTaskShowDownloading,
split
@@ -25,8 +23,6 @@ export const initTaskForm = state => {
cookie: '',
dir,
engineMaxConnectionPerServer,
- followMetalink,
- followTorrent,
maxConnectionPerServer,
newTaskShowDownloading,
out: '',
@@ -98,8 +94,6 @@ export const buildOption = (type, form) => {
result.header = header
}
- result.pauseMetadata = !form.followMetalink
- result.followTorrent = !!form.followTorrent
return result
}
diff --git a/src/shared/locales/en-US/preferences.js b/src/shared/locales/en-US/preferences.js
index 16120f61..e6d95595 100644
--- a/src/shared/locales/en-US/preferences.js
+++ b/src/shared/locales/en-US/preferences.js
@@ -18,6 +18,7 @@ export default {
'transfer-speed-unlimited': 'Unlimited',
'bt-settings': 'BitTorrent',
'bt-save-metadata': 'Save magnet link as torrent file',
+ 'bt-auto-download-content': 'Automatically download magnet and torrent content',
'keep-seeding': 'Keep seeding until stop it manually',
'seed-ratio': 'Seed Ratio',
'seed-time': 'Seed Time',
diff --git a/src/shared/locales/zh-CN/preferences.js b/src/shared/locales/zh-CN/preferences.js
index a62f9dbb..e4a368f3 100644
--- a/src/shared/locales/zh-CN/preferences.js
+++ b/src/shared/locales/zh-CN/preferences.js
@@ -18,6 +18,7 @@ export default {
'transfer-speed-unlimited': '不限速',
'bt-settings': 'BT 设置',
'bt-save-metadata': '保存磁力链接元数据为种子文件',
+ 'bt-auto-download-content': '自动开始下载磁力链接、种子的文件',
'keep-seeding': '持续做种,直到手动停止',
'seed-ratio': '做种分享率',
'seed-time': '做种时间',
@@ -77,7 +78,5 @@ export default {
'baidu-exporter-help': '点此查看使用说明',
'auto-update': '自动更新',
'auto-check-update': '自动检查更新',
- 'last-check-update-time': '上次检查更新时间',
- 'follow-metalink': '自动开始下载磁力链接、种子内的文件',
- 'follow-torrent': '种子下载完后自动下载种子内容'
+ 'last-check-update-time': '上次检查更新时间'
}