修复新旧歌曲信息转换
parent
54ddb7473b
commit
dd2416b5ae
|
@ -9,13 +9,13 @@ declare namespace LX {
|
||||||
size: string | null
|
size: string | null
|
||||||
hash: string
|
hash: string
|
||||||
}
|
}
|
||||||
type _MusicQualityType = Record<Quality, {
|
type _MusicQualityType = Partial<Record<Quality, {
|
||||||
size: string | null
|
size: string | null
|
||||||
}>
|
}>>
|
||||||
type _MusicQualityTypeKg = Record<Quality, {
|
type _MusicQualityTypeKg = Partial<Record<Quality, {
|
||||||
size: string | null
|
size: string | null
|
||||||
hash: string
|
hash: string
|
||||||
}>
|
}>>
|
||||||
|
|
||||||
|
|
||||||
interface MusicInfoMetaBase {
|
interface MusicInfoMetaBase {
|
||||||
|
@ -64,6 +64,7 @@ declare namespace LX {
|
||||||
|
|
||||||
interface MusicInfoMeta_tx extends MusicInfoMeta_online {
|
interface MusicInfoMeta_tx extends MusicInfoMeta_online {
|
||||||
strMediaMid: string // 歌曲strMediaMid
|
strMediaMid: string // 歌曲strMediaMid
|
||||||
|
id?: number // 歌曲songId
|
||||||
albumMid?: string // 歌曲albumMid
|
albumMid?: string // 歌曲albumMid
|
||||||
}
|
}
|
||||||
interface MusicInfo_tx extends MusicInfoBase<'tx'> {
|
interface MusicInfo_tx extends MusicInfoBase<'tx'> {
|
||||||
|
|
|
@ -30,6 +30,7 @@ export const toNewMusicInfo = (oldMusicInfo: any): LX.Music.MusicInfo => {
|
||||||
break
|
break
|
||||||
case 'tx':
|
case 'tx':
|
||||||
meta.strMediaMid = oldMusicInfo.strMediaMid
|
meta.strMediaMid = oldMusicInfo.strMediaMid
|
||||||
|
meta.id = oldMusicInfo.songId
|
||||||
meta.albumMid = oldMusicInfo.albumMid
|
meta.albumMid = oldMusicInfo.albumMid
|
||||||
break
|
break
|
||||||
case 'mg':
|
case 'mg':
|
||||||
|
@ -80,6 +81,7 @@ export const toOldMusicInfo = (minfo: LX.Music.MusicInfo) => {
|
||||||
case 'tx':
|
case 'tx':
|
||||||
oInfo.strMediaMid = minfo.meta.strMediaMid
|
oInfo.strMediaMid = minfo.meta.strMediaMid
|
||||||
oInfo.albumMid = minfo.meta.albumMid
|
oInfo.albumMid = minfo.meta.albumMid
|
||||||
|
oInfo.songId = minfo.meta.id
|
||||||
break
|
break
|
||||||
case 'mg':
|
case 'mg':
|
||||||
oInfo.copyrightId = minfo.meta.copyrightId
|
oInfo.copyrightId = minfo.meta.copyrightId
|
||||||
|
|
Loading…
Reference in New Issue