新增设置-下载设置-同时下载任务数设置(#1498)

pull/2077/head
lyswhut 2024-08-10 14:31:35 +08:00
parent e1bd4c9a0a
commit 0628d3533f
5 changed files with 28 additions and 0 deletions

View File

@ -3,6 +3,7 @@
- 新增 是否将歌词显示在状态栏 设置,默认关闭,该功能只在 MacOS 下可用(#1940
- 新增设置-播放详情页设置-延迟歌词滚动设置(#1985
- 新增鼠标在音量按钮使用滚轮时可以调整音量大小的功能(#2000
- 新增设置-下载设置-同时下载任务数设置(#1498
### 优化

View File

@ -406,6 +406,8 @@
"setting__download_lyric_format_gbk": "GBK (Try to select this format when Chinese garbled characters appear on some devices)",
"setting__download_lyric_format_utf8": "UTF-8",
"setting__download_lyric_title": "Select whether to download the lyrics file",
"setting__download_max_num": "Number of simultaneous download tasks (setting too high may result in IP being blocked, depending on the audio source)",
"setting__download_max_num_tip": "Excessively large number of simultaneous downloads may cause your IP to be blocked by the audio source. Do you confirm the modification?",
"setting__download_name": "Music file naming",
"setting__download_name1": "Title - Artist",
"setting__download_name2": "Artist - Title",

View File

@ -406,6 +406,8 @@
"setting__download_lyric_format_gbk": "GBK在某些设备上出现中文乱码时可尝试选择此格式",
"setting__download_lyric_format_utf8": "UTF-8",
"setting__download_lyric_title": "是否同时下载歌词文件",
"setting__download_max_num": "同时下载任务数(设置过大可能会导致 IP 被封,这取决于音源)",
"setting__download_max_num_tip": "过大的同时下载数量可能会导致你的 IP 被音源封禁,是否确认修改?",
"setting__download_name": "文件命名方式",
"setting__download_name1": "歌名 - 歌手",
"setting__download_name2": "歌手 - 歌名",

View File

@ -406,6 +406,8 @@
"setting__download_lyric_format_gbk": "GBK在某些裝置上出現中文亂碼時可嘗試選擇此格式",
"setting__download_lyric_format_utf8": "UTF-8",
"setting__download_lyric_title": "是否同時下載歌詞文件",
"setting__download_max_num": "同時下載任務數(設定過大可能會導致 IP 被封,這取決於音源)",
"setting__download_max_num_tip": "過大的同時下載數量可能會導致你的 IP 被音源封禁,是否確認修改?",
"setting__download_name": "文件命名方式",
"setting__download_name1": "歌名 - 歌手",
"setting__download_name2": "歌手 - 歌名",

View File

@ -13,6 +13,13 @@ dd(:aria-label="$t('setting__download_path_title')")
span.auto-hidden.hover(:class="$style.savePath" :aria-label="$t('setting__download_path_open_label')" @click="openDirInExplorer(appSetting['download.savePath'])") {{ appSetting['download.savePath'] }}
.p
base-btn.btn(min @click="handleChangeSavePath") {{ $t('setting__download_path_change_btn') }}
dd
h3#download_max_num {{ $t('setting__download_max_num') }}
div
p
base-selection.gap-left(:class="$style.selectWidth" :model-value="appSetting['download.maxDownloadNum']" :list="maxNums" item-key="id" item-name="id" @change="handleUpdateMaxNum")
dd
h3#download_use_other_source
| {{ $t('setting__download_use_other_source') }}
@ -59,6 +66,7 @@ import { computed } from '@common/utils/vueTools'
import { showSelectDialog, openDirInExplorer } from '@renderer/utils/ipc'
import { useI18n } from '@renderer/plugins/i18n'
import { appSetting, updateSetting } from '@renderer/store/setting'
import { dialog } from '@renderer/plugins/Dialog'
export default {
name: 'SettingDownload',
@ -76,6 +84,14 @@ export default {
})
}
const maxNums = new Array(6).fill(null).map((_, i) => ({ id: i + 1 }))
const handleUpdateMaxNum = async({ id }) => {
if (id > 3) {
if (!await dialog.confirm(window.i18n.t('setting__download_max_num_tip'))) return
}
updateSetting({ 'download.maxDownloadNum': id })
}
const musicNames = computed(() => {
return [
{ value: '歌名 - 歌手', name: t('setting__download_name1') },
@ -98,6 +114,8 @@ export default {
handleChangeSavePath,
musicNames,
lrcFormatList,
maxNums,
handleUpdateMaxNum,
}
},
}
@ -107,4 +125,7 @@ export default {
// .savePath {
// font-size: 12px;
// }
.selectWidth {
width: 60px;
}
</style>