mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-07-06 06:51:29 +08:00
feat: add downloader suffix toggles
This commit is contained in:
@@ -117,9 +117,20 @@ function generateId() {
|
|||||||
return Math.random().toString(36).substring(2, 9)
|
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() {
|
function initializeDownloaderInfo() {
|
||||||
downloaderInfo.value = cloneDeep(props.downloader)
|
downloaderInfo.value = cloneDeep(props.downloader)
|
||||||
|
initializeDownloaderConfigDefaults()
|
||||||
pathMappingRows.value = (downloaderInfo.value.path_mapping || []).map(item => ({
|
pathMappingRows.value = (downloaderInfo.value.path_mapping || []).map(item => ({
|
||||||
id: generateId(),
|
id: generateId(),
|
||||||
storage: item[0],
|
storage: item[0],
|
||||||
@@ -299,6 +310,15 @@ onMounted(() => {
|
|||||||
active
|
active
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
|
<VCol cols="12" md="6">
|
||||||
|
<VSwitch
|
||||||
|
v-model="downloaderInfo.config.incomplete_files_ext"
|
||||||
|
:label="t('downloader.incomplete_files_ext')"
|
||||||
|
:hint="t('downloader.incomplete_files_extHint')"
|
||||||
|
persistent-hint
|
||||||
|
active
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
<VRow v-else-if="downloaderInfo.type == 'transmission'">
|
<VRow v-else-if="downloaderInfo.type == 'transmission'">
|
||||||
<VCol cols="12" md="6">
|
<VCol cols="12" md="6">
|
||||||
@@ -344,6 +364,15 @@ onMounted(() => {
|
|||||||
prepend-inner-icon="mdi-lock"
|
prepend-inner-icon="mdi-lock"
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
|
<VCol cols="12" md="6">
|
||||||
|
<VSwitch
|
||||||
|
v-model="downloaderInfo.config.rename_partial_files"
|
||||||
|
:label="t('downloader.rename_partial_files')"
|
||||||
|
:hint="t('downloader.rename_partial_filesHint')"
|
||||||
|
persistent-hint
|
||||||
|
active
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
<VRow v-else-if="downloaderInfo.type == 'rtorrent'">
|
<VRow v-else-if="downloaderInfo.type == 'rtorrent'">
|
||||||
<VCol cols="12" md="6">
|
<VCol cols="12" md="6">
|
||||||
|
|||||||
@@ -3267,6 +3267,10 @@ export default {
|
|||||||
sequentail: 'Sequential Download',
|
sequentail: 'Sequential Download',
|
||||||
force_resume: 'Force Resume',
|
force_resume: 'Force Resume',
|
||||||
first_last_piece: 'First/Last Piece Priority',
|
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',
|
saveSuccess: 'Downloader settings saved successfully',
|
||||||
saveFailed: 'Failed to save downloader settings',
|
saveFailed: 'Failed to save downloader settings',
|
||||||
nameRequired: 'Name cannot be empty',
|
nameRequired: 'Name cannot be empty',
|
||||||
|
|||||||
@@ -3210,6 +3210,10 @@ export default {
|
|||||||
sequentail: '顺序下载',
|
sequentail: '顺序下载',
|
||||||
force_resume: '强制继续',
|
force_resume: '强制继续',
|
||||||
first_last_piece: '优先首尾文件',
|
first_last_piece: '优先首尾文件',
|
||||||
|
incomplete_files_ext: '未完成文件后缀',
|
||||||
|
incomplete_files_extHint: '下载未完成时追加 .!qB 后缀,完成后自动移除',
|
||||||
|
rename_partial_files: '未完成文件后缀',
|
||||||
|
rename_partial_filesHint: '下载未完成时追加 .part 后缀,完成后自动移除',
|
||||||
saveSuccess: '下载器设置保存成功',
|
saveSuccess: '下载器设置保存成功',
|
||||||
saveFailed: '下载器设置保存失败',
|
saveFailed: '下载器设置保存失败',
|
||||||
nameRequired: '不能为空,且不能重名',
|
nameRequired: '不能为空,且不能重名',
|
||||||
|
|||||||
@@ -3209,6 +3209,10 @@ export default {
|
|||||||
sequentail: '順序下載',
|
sequentail: '順序下載',
|
||||||
force_resume: '強制繼續',
|
force_resume: '強制繼續',
|
||||||
first_last_piece: '優先首尾文件',
|
first_last_piece: '優先首尾文件',
|
||||||
|
incomplete_files_ext: '未完成文件後綴',
|
||||||
|
incomplete_files_extHint: '下載未完成時追加 .!qB 後綴,完成後自動移除',
|
||||||
|
rename_partial_files: '未完成文件後綴',
|
||||||
|
rename_partial_filesHint: '下載未完成時追加 .part 後綴,完成後自動移除',
|
||||||
saveSuccess: '下載器設置保存成功',
|
saveSuccess: '下載器設置保存成功',
|
||||||
saveFailed: '下載器設置保存失敗',
|
saveFailed: '下載器設置保存失敗',
|
||||||
nameRequired: '名稱不能為空',
|
nameRequired: '名稱不能為空',
|
||||||
|
|||||||
Reference in New Issue
Block a user