From dd2416b5ae909c9d696b7ccb1d6bbbdc75a6861f Mon Sep 17 00:00:00 2001 From: lyswhut Date: Mon, 26 Dec 2022 14:14:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=B0=E6=97=A7=E6=AD=8C?= =?UTF-8?q?=E6=9B=B2=E4=BF=A1=E6=81=AF=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/types/music.d.ts | 9 +++++---- src/common/utils/tools.ts | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/common/types/music.d.ts b/src/common/types/music.d.ts index e3a7ab5e..12be91bf 100644 --- a/src/common/types/music.d.ts +++ b/src/common/types/music.d.ts @@ -9,13 +9,13 @@ declare namespace LX { size: string | null hash: string } - type _MusicQualityType = Record - type _MusicQualityTypeKg = Record> + type _MusicQualityTypeKg = Partial + }>> interface MusicInfoMetaBase { @@ -64,6 +64,7 @@ declare namespace LX { interface MusicInfoMeta_tx extends MusicInfoMeta_online { strMediaMid: string // 歌曲strMediaMid + id?: number // 歌曲songId albumMid?: string // 歌曲albumMid } interface MusicInfo_tx extends MusicInfoBase<'tx'> { diff --git a/src/common/utils/tools.ts b/src/common/utils/tools.ts index 2c642b63..24f11eea 100644 --- a/src/common/utils/tools.ts +++ b/src/common/utils/tools.ts @@ -30,6 +30,7 @@ export const toNewMusicInfo = (oldMusicInfo: any): LX.Music.MusicInfo => { break case 'tx': meta.strMediaMid = oldMusicInfo.strMediaMid + meta.id = oldMusicInfo.songId meta.albumMid = oldMusicInfo.albumMid break case 'mg': @@ -80,6 +81,7 @@ export const toOldMusicInfo = (minfo: LX.Music.MusicInfo) => { case 'tx': oInfo.strMediaMid = minfo.meta.strMediaMid oInfo.albumMid = minfo.meta.albumMid + oInfo.songId = minfo.meta.id break case 'mg': oInfo.copyrightId = minfo.meta.copyrightId