Skip to content

Commit

Permalink
Merge pull request #980 from dicarne/master
Browse files Browse the repository at this point in the history
fix: tasks list has old wrong items and add switch for auto download torrent
  • Loading branch information
agalwood authored Jun 19, 2021
2 parents 509c799 + 6016151 commit 3245bbd
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/main/core/ConfigManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export default class ConfigManager {
'dht-file-path6': getDhtPath(IP_VERSION.V6),
'dht-listen-port': 26701,
'dir': getUserDownloadsPath(),
'follow-metalink': false,
'follow-torrent': false,
'listen-port': 21301,
'max-concurrent-downloads': 5,
'max-connection-per-server': getMaxConnectionPerServer(),
Expand Down
18 changes: 18 additions & 0 deletions src/renderer/components/Preference/Basic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,20 @@
: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>
Expand Down Expand Up @@ -271,6 +285,8 @@
btSaveMetadata,
dir,
engineMaxConnectionPerServer,
followMetalink,
followTorrent,
hideAppMenu,
keepSeeding,
keepWindowState,
Expand All @@ -296,6 +312,8 @@
continue: config.continue,
dir,
engineMaxConnectionPerServer,
followMetalink,
followTorrent,
hideAppMenu,
keepSeeding,
keepWindowState,
Expand Down
6 changes: 5 additions & 1 deletion src/renderer/components/TaskDetail/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@
}
})
merge(cached.files, result)
return cached.files
},
selectedFileList () {
Expand All @@ -185,6 +184,11 @@
window.removeEventListener('resize', this.handleAppResize)
cached.files = []
},
watch: {
gid () {
cached.files = []
}
},
methods: {
handleClose (done) {
window.removeEventListener('resize', this.handleAppResize)
Expand Down
7 changes: 7 additions & 0 deletions src/renderer/utils/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export const initTaskForm = state => {
allProxy,
dir,
engineMaxConnectionPerServer,
followMetalink,
followTorrent,
maxConnectionPerServer,
newTaskShowDownloading,
split
Expand All @@ -23,6 +25,8 @@ export const initTaskForm = state => {
cookie: '',
dir,
engineMaxConnectionPerServer,
followMetalink,
followTorrent,
maxConnectionPerServer,
newTaskShowDownloading,
out: '',
Expand Down Expand Up @@ -93,6 +97,9 @@ export const buildOption = (type, form) => {
if (!isEmpty(header)) {
result.header = header
}

result.pauseMetadata = !form.followMetalink
result.followTorrent = !!form.followTorrent
return result
}

Expand Down
4 changes: 3 additions & 1 deletion src/shared/locales/zh-CN/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,7 @@ export default {
'baidu-exporter-help': '点此查看使用说明',
'auto-update': '自动更新',
'auto-check-update': '自动检查更新',
'last-check-update-time': '上次检查更新时间'
'last-check-update-time': '上次检查更新时间',
'follow-metalink': '自动开始下载磁力链接、种子内的文件',
'follow-torrent': '种子下载完后自动下载种子内容'
}

0 comments on commit 3245bbd

Please sign in to comment.