From 8b988b227bf35f8245d542c0d73cef3ac8dc6359 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sun, 20 Mar 2022 00:43:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8B=E8=BD=BD=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=92=AD=E6=94=BE=E6=AD=8C=E6=9B=B2=E5=BA=8F=E5=8F=B7?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 1 + src/renderer/core/useApp/usePlayer/useWatchList.js | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index 9fb7e0a2..4279e660 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -20,6 +20,7 @@ - 修复AppImage包无法运行的问题 - 修复Windows任务栏缩略图工具栏控制按钮的歌曲收藏按钮状态更新问题 - 修复使用链接导入的歌单无法在我的列表打开原歌单详情页的问题 +- 修复播放下载列表的歌曲时增删下载任务导致正在的歌曲序号改变时,不会更新到新增序号的问题 ### 文档 diff --git a/src/renderer/core/useApp/usePlayer/useWatchList.js b/src/renderer/core/useApp/usePlayer/useWatchList.js index 284fbbd5..57cb777e 100644 --- a/src/renderer/core/useApp/usePlayer/useWatchList.js +++ b/src/renderer/core/useApp/usePlayer/useWatchList.js @@ -1,6 +1,6 @@ import { onBeforeUnmount } from '@renderer/utils/vueTools' -import { player as eventPlayerNames, list as eventListNames } from '@renderer/event/names' +import { player as eventPlayerNames, list as eventListNames, download as eventDownloadNames } from '@renderer/event/names' import { playInfo, playMusicInfo, updatePlayIndex } from '@renderer/core/share/player' import { getList } from '@renderer/core/share/utils' import { throttle } from '@renderer/utils' @@ -30,9 +30,15 @@ export default ({ playNext }) => { throttleListChange() } + const handleDownloadListChange = () => { + handleListChange(['download']) + } + window.eventHub.on(eventListNames.listChange, handleListChange) + window.eventHub.on(eventDownloadNames.listChange, handleDownloadListChange) onBeforeUnmount(() => { window.eventHub.off(eventListNames.listChange, handleListChange) + window.eventHub.off(eventDownloadNames.listChange, handleDownloadListChange) }) }