Skip to content

A full-featured download manager.

refactor: bt complete show seeding tips #179 #134

Dr_rOotd0085b295d85
diff --git a/src/renderer/components/Native/EngineClient.vue b/src/renderer/components/Native/EngineClient.vue
index 3485ed6d..27340f4d 100644
--- a/src/renderer/components/Native/EngineClient.vue
+++ b/src/renderer/components/Native/EngineClient.vue
@@ -107,7 +107,7 @@
const [{ gid }] = event
this.fetchTaskItem({ gid })
.then((task) => {
- this.showTaskCompleteNotify(task)
+ this.handleDownloadComplete(task, false)
})
},
onBtDownloadComplete: function (event) {
@@ -116,26 +116,39 @@
const [{ gid }] = event
this.fetchTaskItem({ gid })
.then((task) => {
- this.showTaskCompleteNotify(task)
+ this.handleDownloadComplete(task, true)
})
},
- showTaskCompleteNotify: function (task) {
- if (!this.taskNotification) {
- return
- }
-
- const taskName = getTaskName(task)
+ handleDownloadComplete: function (task, isBT) {
const path = getTaskFullPath(task)
addToRecentTask(task)
openDownloadDock(path)
- const message = this.$t('task.download-complete-message', { taskName })
- this.$msg.success(message)
+ this.showTaskCompleteNotify(task, isBT, path)
+ },
+ showTaskCompleteNotify: function (task, isBT, path) {
+ const taskName = getTaskName(task)
+ const message = isBT
+ ? this.$t('task.bt-download-complete-message', { taskName })
+ : this.$t('task.download-complete-message', { taskName })
+ const tips = isBT
+ ? '\n' + this.$t('task.bt-download-complete-tips')
+ : ''
+
+ this.$msg.success(`${message}${tips}`)
+
+ if (!this.taskNotification) {
+ return
+ }
/* eslint-disable no-new */
- const notify = new Notification(this.$t('task.download-complete-notify'), {
- body: taskName
+ const notifyMessage = isBT
+ ? this.$t('task.bt-download-complete-notify')
+ : this.$t('task.download-complete-notify')
+
+ const notify = new Notification(notifyMessage, {
+ body: `${taskName}${tips}`
})
notify.onclick = () => {
showItemInFolder(path, {
@@ -144,15 +157,15 @@
}
},
showTaskErrorNotify: function (task) {
- if (!this.taskNotification) {
- return
- }
-
const taskName = getTaskName(task)
const message = this.$t('task.download-fail-message', { taskName })
this.$msg.success(message)
+ if (!this.taskNotification) {
+ return
+ }
+
/* eslint-disable no-new */
new Notification(this.$t('task.download-fail-notify'), {
body: taskName
diff --git a/src/shared/locales/de/task.js b/src/shared/locales/de/task.js
index 466b29a3..4f800436 100644
--- a/src/shared/locales/de/task.js
+++ b/src/shared/locales/de/task.js
@@ -74,6 +74,9 @@ export default {
'download-error-message': 'Fehler beim Download von {{taskName}} aufgetreten',
'download-complete-message': 'Download von {{taskName}} abgeschlossen',
'download-complete-notify': 'Download abgeschlossen',
+ 'bt-download-complete-message': 'Download von {{taskName}} abgeschlossen, aussaat...',
+ 'bt-download-complete-notify': 'BT Download abgeschlossen, Aussaat...',
+ 'bt-download-complete-tips': 'Tipps: Sie können die Aufgabe stoppen, die aussaat zu beenden',
'download-fail-message': 'Download von {{taskName}} fehlgeschlagen',
'download-fail-notify': 'Download fehlgeschlagen'
}
diff --git a/src/shared/locales/en-US/task.js b/src/shared/locales/en-US/task.js
index 0eaefe81..da7fbd97 100644
--- a/src/shared/locales/en-US/task.js
+++ b/src/shared/locales/en-US/task.js
@@ -74,6 +74,9 @@ export default {
'download-error-message': '{{taskName}} download error occurred',
'download-complete-message': '{{taskName}} download completed',
'download-complete-notify': 'Download Completed',
+ 'bt-download-complete-message': '{{taskName}} download completed, seeding',
+ 'bt-download-complete-notify': 'BT Download Completed, Seeding...',
+ 'bt-download-complete-tips': 'Tips: You can stop the task to end the seeding',
'download-fail-message': '{{taskName}} download failed',
'download-fail-notify': 'Download Failed'
}
diff --git a/src/shared/locales/fr/task.js b/src/shared/locales/fr/task.js
index e08bf6b2..4e456c93 100644
--- a/src/shared/locales/fr/task.js
+++ b/src/shared/locales/fr/task.js
@@ -74,6 +74,9 @@ export default {
'download-error-message': '{{taskName}} une erreur c\'est produite',
'download-complete-message': '{{taskName}} téléchargement terminé',
'download-complete-notify': 'Téléchargement Terminé',
+ 'bt-download-complete-message': '{{taskName}} téléchargement terminé, ensemencement...',
+ 'bt-download-complete-notify': 'BT Télécharger Terminé, Ensemencement...',
+ 'bt-download-complete-tips': 'Astuces: Vous pouvez arrêter la tâche pour mettre fin à l\'ensemencement',
'download-fail-message': '{{taskName}} téléchargement échoué',
'download-fail-notify': 'Téléchargement Échoué'
}
diff --git a/src/shared/locales/pt-BR/task.js b/src/shared/locales/pt-BR/task.js
index 2d1a3085..ef2001de 100644
--- a/src/shared/locales/pt-BR/task.js
+++ b/src/shared/locales/pt-BR/task.js
@@ -74,6 +74,9 @@ export default {
'download-error-message': '{{taskName}} ocorreu um erro no download',
'download-complete-message': '{{taskName}} download completado',
'download-complete-notify': 'Download Completado',
+ 'bt-download-complete-message': '{{taskName}} download completado, propagação ...',
+ 'bt-download-complete-notify': 'Download do BT concluído, Propagação ...',
+ 'bt-download-complete-tips': 'Dicas: você pode parar a tarefa para terminar a propagação',
'download-fail-message': '{{taskName}} falha no download',
'download-fail-notify': 'Falha no Download'
}
diff --git a/src/shared/locales/tr/task.js b/src/shared/locales/tr/task.js
index fbfa3cff..91dc96ad 100644
--- a/src/shared/locales/tr/task.js
+++ b/src/shared/locales/tr/task.js
@@ -74,6 +74,9 @@ export default {
'download-error-message': '{{taskName}} görevinde hata oluştu',
'download-complete-message': '{{taskName}} görevi tamamlandı',
'download-complete-notify': 'İndirme bitti',
+ 'bt-download-complete-message': '{{taskName}} indirme tamamlandı, tohumlama...',
+ 'bt-download-complete-notify': 'BT Indirme tamamlandı, tohumlama...',
+ 'bt-download-complete-tips': 'Ipuçları: Eğer tohumlama sona erdirmek için görev durdurabilirsiniz',
'download-fail-message': '{{taskName}} görevi indirilemedi',
'download-fail-notify': 'İndirme başarısız'
}
diff --git a/src/shared/locales/zh-CN/task.js b/src/shared/locales/zh-CN/task.js
index 18955508..621f3555 100644
--- a/src/shared/locales/zh-CN/task.js
+++ b/src/shared/locales/zh-CN/task.js
@@ -74,6 +74,9 @@ export default {
'download-error-message': '{{taskName}} 下载发生错误',
'download-complete-message': '{{taskName}} 下载完成',
'download-complete-notify': '下载完成',
+ 'bt-download-complete-message': '{{taskName}} 下载完成,正在做种...',
+ 'bt-download-complete-notify': 'BT 任务下载完成,正在做种...',
+ 'bt-download-complete-tips': '提示:你可以停止任务结束做种',
'download-fail-message': '{{taskName}} 下载失败',
'download-fail-notify': '下载失败'
}
diff --git a/src/shared/locales/zh-TW/task.js b/src/shared/locales/zh-TW/task.js
index 12349216..ca57538b 100644
--- a/src/shared/locales/zh-TW/task.js
+++ b/src/shared/locales/zh-TW/task.js
@@ -74,6 +74,9 @@ export default {
'download-error-message': '{{taskName}} 下載錯誤',
'download-complete-message': '{{taskName}} 下載完成',
'download-complete-notify': '下載完成',
+ 'bt-download-complete-message': '{{taskName}} 下載完成,正在做種...',
+ 'bt-download-complete-notify': 'BT 任務下載完成,正在做種...',
+ 'bt-download-complete-tips': '提示:你可以停止任務結束做種',
'download-fail-message': '{{taskName}} 下載失敗',
'download-fail-notify': '下載失敗'
}