From ea5839e3c74f50477223e89c7d45670ca7b61a30 Mon Sep 17 00:00:00 2001
From: zhangda <221830074@smail.nju.edu.cn>
Date: Tue, 31 Dec 2024 11:16:18 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9songs=E5=92=8CdisplaySongs?=
 =?UTF-8?q?=E7=9A=84=E8=B5=8B=E5=80=BC=EF=BC=8C=E9=81=BF=E5=85=8D=E6=8C=87?=
 =?UTF-8?q?=E5=90=91=E5=90=8C=E4=B8=80=E4=B8=AA=E6=95=B0=E7=BB=84=20?=
 =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4=E6=AD=8C=E5=8D=95=E6=AD=8C?=
 =?UTF-8?q?=E6=9B=B2=E4=B8=8D=E5=8F=8A=E6=97=B6=E6=98=BE=E7=A4=BA=E5=88=A0?=
 =?UTF-8?q?=E9=99=A4=E5=90=8E=E7=9A=84=E6=A0=B7=E5=AD=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/components/MusicAlbumView.vue | 6 +++++-
 src/views/HomePage.vue            | 4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/components/MusicAlbumView.vue b/src/components/MusicAlbumView.vue
index be9ed03..8f3264e 100644
--- a/src/components/MusicAlbumView.vue
+++ b/src/components/MusicAlbumView.vue
@@ -254,8 +254,12 @@ const removeMusicFromAlbum = (albumId, songId) => {
 	removeSongFromPlaylist({
 		playlist_id: albumId,
 		song_id: songId,
-	})
+	}).then(() => {
+    const songIndex = props.musicList.findIndex(song => song.id === songId);
+    props.musicList.splice(songIndex, 1)
+  })
 }
+
 const enterMusicDescription = (musicId) => {
 }
 const enterArtistDescription = (artistName) => {
diff --git a/src/views/HomePage.vue b/src/views/HomePage.vue
index 981865b..591240e 100644
--- a/src/views/HomePage.vue
+++ b/src/views/HomePage.vue
@@ -711,7 +711,7 @@ onMounted(() => {
 			playlist_id: currentPlaylistId.value,
 		}).then((res) => {
 			songs.value = res.data.result;
-			displayingSongs.value = res.data.result;
+			displayingSongs.value = [...res.data.result];
 			currentSongId.value = songs.value[0].id;
 			
 			// TODO: currentSongIndex != currentSongId ?
@@ -774,7 +774,7 @@ const pauseCurrentSong = () => {
 
 const updateSongs = (newSongs) => {
 	songs.value = newSongs;
-	displayingSongs.value = newSongs;
+	displayingSongs.value = [...newSongs];
 };
 </script>
 
-- 
GitLab