mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-07-04 16:28:56 +08:00
修复kg id重复导致的列表显示问题
This commit is contained in:
parent
e74771761e
commit
84a7811c09
@ -30,6 +30,14 @@ export const toNewMusicInfo = (oldMusicInfo: any): LX.Music.MusicInfo => {
|
|||||||
albumName: oldMusicInfo.albumName, // 歌曲专辑名称
|
albumName: oldMusicInfo.albumName, // 歌曲专辑名称
|
||||||
picUrl: oldMusicInfo.img, // 歌曲图片链接
|
picUrl: oldMusicInfo.img, // 歌曲图片链接
|
||||||
}
|
}
|
||||||
|
const newInfo = {
|
||||||
|
id: `${oldMusicInfo.source as string}_${oldMusicInfo.songmid as string}`,
|
||||||
|
name: oldMusicInfo.name,
|
||||||
|
singer: oldMusicInfo.singer,
|
||||||
|
source: oldMusicInfo.source,
|
||||||
|
interval: oldMusicInfo.interval,
|
||||||
|
meta: meta as LX.Music.MusicInfoOnline['meta'],
|
||||||
|
}
|
||||||
|
|
||||||
if (oldMusicInfo.source == 'local') {
|
if (oldMusicInfo.source == 'local') {
|
||||||
meta.filePath = oldMusicInfo.filePath ?? oldMusicInfo.songmid ?? ''
|
meta.filePath = oldMusicInfo.filePath ?? oldMusicInfo.songmid ?? ''
|
||||||
@ -51,6 +59,7 @@ export const toNewMusicInfo = (oldMusicInfo: any): LX.Music.MusicInfo => {
|
|||||||
switch (oldMusicInfo.source) {
|
switch (oldMusicInfo.source) {
|
||||||
case 'kg':
|
case 'kg':
|
||||||
meta.hash = oldMusicInfo.hash
|
meta.hash = oldMusicInfo.hash
|
||||||
|
newInfo.id = oldMusicInfo.songmid + '_' + oldMusicInfo.hash
|
||||||
break
|
break
|
||||||
case 'tx':
|
case 'tx':
|
||||||
meta.strMediaMid = oldMusicInfo.strMediaMid
|
meta.strMediaMid = oldMusicInfo.strMediaMid
|
||||||
@ -66,14 +75,7 @@ export const toNewMusicInfo = (oldMusicInfo: any): LX.Music.MusicInfo => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return newInfo
|
||||||
id: `${oldMusicInfo.source as string}_${oldMusicInfo.songmid as string}`,
|
|
||||||
name: oldMusicInfo.name,
|
|
||||||
singer: oldMusicInfo.singer,
|
|
||||||
source: oldMusicInfo.source,
|
|
||||||
interval: oldMusicInfo.interval,
|
|
||||||
meta: meta as LX.Music.MusicInfoOnline['meta'],
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const toOldMusicInfo = (minfo: LX.Music.MusicInfo): any => {
|
export const toOldMusicInfo = (minfo: LX.Music.MusicInfo): any => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user