新增设置-下载设置-是否嵌入翻译歌词、罗马音歌词设置

pull/1211/head
lyswhut 2023-02-09 17:52:23 +08:00
parent 80197ee18c
commit 02402f5207
8 changed files with 28 additions and 2 deletions

View File

@ -9,6 +9,7 @@
- 新增是否在更新版本的首次启动时显示更新日志弹窗设置,默认开启,可以去设置-软件更新更改
- 新增播放速率调整功能可以去播放详情页的控制按钮调整范围限制为x0.5至x2之间#13
- 添加wy、tx源逐字歌词的支持
- 新增设置-下载设置-是否嵌入翻译歌词、罗马音歌词设置,默认关闭
- 添加启动时的数据库表及表结构完整性校验,若未通过校验,则会显示弹窗提示后将该数据库重命名添加`.bak`后缀后重建数据库启动。对于某些人遇到更新到v2.0.0后出现之前收藏的歌曲全部丢失或者歌曲无法添加到列表的问题,可以通过此特性自动重建数据库并重新迁移数据,不再需要手动去数据目录删除数据库
### 优化

View File

@ -89,6 +89,8 @@ const defaultSetting: LX.AppSetting = {
'download.lrcFormat': 'utf8',
'download.isEmbedPic': true,
'download.isEmbedLyric': false,
'download.isEmbedLyricT': false,
'download.isEmbedLyricR': false,
'download.isUseOtherSource': false,
'search.isShowHotSearch': false,

View File

@ -409,6 +409,16 @@ declare global {
*/
'download.isEmbedLyric': boolean
/**
*
*/
'download.isEmbedLyricT': boolean
/**
*
*/
'download.isEmbedLyricR': boolean
/**
*
*/

View File

@ -335,6 +335,7 @@
"setting__download_data_embed": "Whether to embed the following content in the audio file",
"setting__download_embed_lyric": "Embedding lyric",
"setting__download_embed_pic": "Embedding cover",
"setting__download_embed_tlyric": "Also embed translated lyrics (if available)",
"setting__download_enable": "Whether to enable download function",
"setting__download_lyric": "Lyrics download",
"setting__download_lyric_format": "Downloaded lyrics file encoding format",

View File

@ -337,6 +337,8 @@
"setting__download_data_embed": "是否将以下内容嵌入到音频文件中",
"setting__download_embed_lyric": "歌词嵌入",
"setting__download_embed_pic": "封面嵌入",
"setting__download_embed_rlyric": "同时嵌入罗马音歌词(如果有)",
"setting__download_embed_tlyric": "同时嵌入翻译歌词(如果有)",
"setting__download_enable": "是否启用下载功能",
"setting__download_lyric": "歌词下载",
"setting__download_lyric_format": "下载的歌词文件编码格式",

View File

@ -336,6 +336,7 @@
"setting__download_data_embed": "是否將以下內容嵌入到音頻文件中",
"setting__download_embed_lyric": "歌詞嵌入",
"setting__download_embed_pic": "封面嵌入",
"setting__download_embed_tlyric": "同時嵌入翻譯歌詞(如果有)",
"setting__download_enable": "是否啟用下載功能",
"setting__download_lyric": "歌詞下載",
"setting__download_lyric_format": "下載的歌詞文件編碼格式",

View File

@ -148,13 +148,18 @@ const saveMeta = (downloadInfo: LX.Download.ListItem) => {
: Promise.resolve(null),
]
void Promise.all(tasks).then(([imgUrl, lyrics]) => {
if (lyrics?.lyric) lyrics.lyric = fixKgLyric(lyrics.lyric)
let lyric: null | string = null
if (lyrics?.lyric) {
lyric = fixKgLyric(lyrics.lyric)
if (appSetting['download.isEmbedLyricT'] && lyrics.tlyric) lyric += '\n' + lyrics.tlyric + '\n'
if (appSetting['download.isEmbedLyricR'] && lyrics.rlyric) lyric += '\n' + lyrics.rlyric + '\n'
}
void window.lx.worker.download.writeMeta(downloadInfo.metadata.filePath, {
title: downloadInfo.metadata.musicInfo.name,
artist: downloadInfo.metadata.musicInfo.singer,
album: downloadInfo.metadata.musicInfo.meta.albumName,
APIC: imgUrl,
lyrics: lyrics?.lyric ?? null,
lyrics: lyric,
})
})
}

View File

@ -31,6 +31,10 @@ dd
base-checkbox(id="setting_download_isEmbedPic" :modelValue="appSetting['download.isEmbedPic']" @update:modelValue="updateSetting({'download.isEmbedPic': $event})" :label="$t('setting__download_embed_pic')")
.gap-top
base-checkbox(id="setting_download_isEmbedLyric" :modelValue="appSetting['download.isEmbedLyric']" @update:modelValue="updateSetting({'download.isEmbedLyric': $event})" :label="$t('setting__download_embed_lyric')")
.gap-top
base-checkbox(id="setting_download_isEmbedLyricT" :disabled="!appSetting['download.isEmbedLyric']" :modelValue="appSetting['download.isEmbedLyricT']" @update:modelValue="updateSetting({'download.isEmbedLyricT': $event})" :label="$t('setting__download_embed_tlyric')")
.gap-top
base-checkbox(id="setting_download_isEmbedLyricR" :disabled="!appSetting['download.isEmbedLyric']" :modelValue="appSetting['download.isEmbedLyricR']" @update:modelValue="updateSetting({'download.isEmbedLyricR': $event})" :label="$t('setting__download_embed_rlyric')")
dd(:aria-label="$t('setting__download_lyric_title')")
h3#download_lyric {{$t('setting__download_lyric')}}
.gap-top