修复 m4a 文件歌曲内嵌歌词无法读取的问题(#2090)
parent
f21d2bc7c7
commit
7ac638c52c
|
@ -14,6 +14,7 @@
|
|||
|
||||
- 修复歌单详情页内歌单名字过长时的UI显示问题(#2028)
|
||||
- 修复获取自定义环境音效预设列表逻辑问题
|
||||
- 修复 m4a 文件歌曲内嵌歌词无法读取的问题(#2090)
|
||||
|
||||
### 变更
|
||||
|
||||
|
|
|
@ -201,10 +201,15 @@ export const getLocalMusicFileLyric = async(path: string): Promise<LX.Music.Lyri
|
|||
|
||||
// 尝试读取文件内歌词
|
||||
const metadata = await getFileMetadata(path)
|
||||
// console.log(metadata)
|
||||
if (!metadata) return null
|
||||
if (metadata.common.lyrics?.[0]?.text && metadata.common.lyrics[0].text.length > 10) {
|
||||
return {
|
||||
lyric: metadata.common.lyrics[0].text,
|
||||
let lyricInfo = metadata.common.lyrics?.[0]
|
||||
if (lyricInfo) {
|
||||
let lyric: string | undefined
|
||||
if (typeof lyricInfo == 'object') lyric = lyricInfo.text
|
||||
else if (typeof lyricInfo == 'string') lyric = lyricInfo
|
||||
if (lyric && lyric.length > 10) {
|
||||
return { lyric }
|
||||
}
|
||||
}
|
||||
// console.log(metadata)
|
||||
|
|
Loading…
Reference in New Issue