Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tasks list has old wrong items and add switch for auto download torrent #980

Merged
merged 3 commits into from
Jun 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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': '种子下载完后自动下载种子内容'
}