更新 歌曲换源 机制

This commit is contained in:
lyswhut
2025-04-09 09:24:45 +08:00
parent 98d67be9d9
commit 36262ff166
7 changed files with 70 additions and 32 deletions
+17
View File
@@ -232,6 +232,23 @@ const handlePlay = () => {
})
}
/**
* 播放列表内歌曲
* @param listId 列表id
* @param id 歌曲id
*/
export const playListById = (listId: string, id: string) => {
const prevListId = playInfo.playerListId
setPlayListId(listId)
// pause()
const musicInfo = getList(listId).find(m => m.id == id)
if (!musicInfo) return
setPlayMusicInfo(listId, musicInfo)
if (appSetting['player.isAutoCleanPlayedList'] || prevListId != listId) clearPlayedList()
clearTempPlayeList()
handlePlay()
}
/**
* 播放列表内歌曲
* @param listId 列表id