From c1c031158668af4a16106a6b06b62059a9262397 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Thu, 17 Oct 2024 12:36:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E5=86=8D=E7=BC=93=E5=AD=98=E6=8D=A2?= =?UTF-8?q?=E6=BA=90=E6=AD=8C=E6=9B=B2=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 4 ++++ src/renderer/core/music/utils.ts | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index 2c5d03dc..9066c241 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -15,6 +15,10 @@ - 修复歌单详情页内歌单名字过长时的UI显示问题(#2028) - 修复获取自定义环境音效预设列表逻辑问题 +### 变更 + +- 不再缓存换源歌曲信息 + ### 其他 - 更新 electron 到 v30.5.1 diff --git a/src/renderer/core/music/utils.ts b/src/renderer/core/music/utils.ts index 098c2f96..eb89772b 100644 --- a/src/renderer/core/music/utils.ts +++ b/src/renderer/core/music/utils.ts @@ -2,8 +2,8 @@ import { qualityList } from '@renderer/store' import { assertApiSupport } from '@renderer/store/utils' import musicSdk from '@renderer/utils/musicSdk' import { - getOtherSource as getOtherSourceFromStore, - saveOtherSource as saveOtherSourceFromStore, + // getOtherSource as getOtherSourceFromStore, + // saveOtherSource as saveOtherSourceFromStore, getMusicUrl as getStoreMusicUrl, getPlayerLyric as getStoreLyric, } from '@renderer/utils/ipc' @@ -17,10 +17,10 @@ const getOtherSourcePromises = new Map() export const existTimeExp = /\[\d{1,2}:.*\d{1,4}\]/ export const getOtherSource = async(musicInfo: LX.Music.MusicInfo | LX.Download.ListItem, isRefresh = false): Promise => { - if (!isRefresh && musicInfo.id) { - const cachedInfo = await getOtherSourceFromStore(musicInfo.id) - if (cachedInfo.length) return cachedInfo - } + // if (!isRefresh && musicInfo.id) { + // const cachedInfo = await getOtherSourceFromStore(musicInfo.id) + // if (cachedInfo.length) return cachedInfo + // } let key: string let searchMusicInfo: { name: string @@ -61,7 +61,7 @@ export const getOtherSource = async(musicInfo: LX.Music.MusicInfo | LX.Download. if (timeout) clearTimeout(timeout) }) }).then((otherSource) => { - if (otherSource.length) void saveOtherSourceFromStore(musicInfo.id, otherSource) + // if (otherSource.length) void saveOtherSourceFromStore(musicInfo.id, otherSource) return otherSource }).finally(() => { if (getOtherSourcePromises.has(key)) getOtherSourcePromises.delete(key)