diff --git a/src/components/dialog/DownloaderInfoDialog.vue b/src/components/dialog/DownloaderInfoDialog.vue index 826ebc1f..5d2d9d8a 100644 --- a/src/components/dialog/DownloaderInfoDialog.vue +++ b/src/components/dialog/DownloaderInfoDialog.vue @@ -117,9 +117,20 @@ function generateId() { return Math.random().toString(36).substring(2, 9) } +/** 初始化下载器新增配置项的兼容默认值。 */ +function initializeDownloaderConfigDefaults() { + if (!['qbittorrent', 'transmission'].includes(downloaderInfo.value.type)) return + if (!downloaderInfo.value.config) downloaderInfo.value.config = {} + if (downloaderInfo.value.type === 'qbittorrent' && downloaderInfo.value.config.incomplete_files_ext === undefined) + downloaderInfo.value.config.incomplete_files_ext = true + if (downloaderInfo.value.type === 'transmission' && downloaderInfo.value.config.rename_partial_files === undefined) + downloaderInfo.value.config.rename_partial_files = true +} + /** 初始化下载器编辑表单数据。 */ function initializeDownloaderInfo() { downloaderInfo.value = cloneDeep(props.downloader) + initializeDownloaderConfigDefaults() pathMappingRows.value = (downloaderInfo.value.path_mapping || []).map(item => ({ id: generateId(), storage: item[0], @@ -299,6 +310,15 @@ onMounted(() => { active /> + + + @@ -344,6 +364,15 @@ onMounted(() => { prepend-inner-icon="mdi-lock" /> + + + diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 6a42bd60..c5584677 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -3267,6 +3267,10 @@ export default { sequentail: 'Sequential Download', force_resume: 'Force Resume', first_last_piece: 'First/Last Piece Priority', + incomplete_files_ext: 'Incomplete File Suffix', + incomplete_files_extHint: 'Append .!qB while downloading and remove it after completion', + rename_partial_files: 'Incomplete File Suffix', + rename_partial_filesHint: 'Append .part while downloading and remove it after completion', saveSuccess: 'Downloader settings saved successfully', saveFailed: 'Failed to save downloader settings', nameRequired: 'Name cannot be empty', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 7dfc2ce9..9e8e691d 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -3210,6 +3210,10 @@ export default { sequentail: '顺序下载', force_resume: '强制继续', first_last_piece: '优先首尾文件', + incomplete_files_ext: '未完成文件后缀', + incomplete_files_extHint: '下载未完成时追加 .!qB 后缀,完成后自动移除', + rename_partial_files: '未完成文件后缀', + rename_partial_filesHint: '下载未完成时追加 .part 后缀,完成后自动移除', saveSuccess: '下载器设置保存成功', saveFailed: '下载器设置保存失败', nameRequired: '不能为空,且不能重名', diff --git a/src/locales/zh-TW.ts b/src/locales/zh-TW.ts index 098a346f..3c763b13 100644 --- a/src/locales/zh-TW.ts +++ b/src/locales/zh-TW.ts @@ -3209,6 +3209,10 @@ export default { sequentail: '順序下載', force_resume: '強制繼續', first_last_piece: '優先首尾文件', + incomplete_files_ext: '未完成文件後綴', + incomplete_files_extHint: '下載未完成時追加 .!qB 後綴,完成後自動移除', + rename_partial_files: '未完成文件後綴', + rename_partial_filesHint: '下載未完成時追加 .part 後綴,完成後自動移除', saveSuccess: '下載器設置保存成功', saveFailed: '下載器設置保存失敗', nameRequired: '名稱不能為空',