修复kg id重复导致的问题
parent
cd423752d1
commit
9d070b3671
|
@ -6,6 +6,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}_${oldMusicInfo.songmid}`,
|
||||||
|
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 ?? ''
|
||||||
|
@ -27,6 +35,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
|
||||||
|
@ -42,14 +51,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) => {
|
export const toOldMusicInfo = (minfo: LX.Music.MusicInfo) => {
|
||||||
|
|
Loading…
Reference in New Issue