From 8cccf2ed24e747b3236b859d328d074bcbf7cbb1 Mon Sep 17 00:00:00 2001 From: saopig1 <4x7sw862st@gmail.com> Date: Thu, 7 May 2026 20:35:35 +0800 Subject: [PATCH] fix(web): album hero shows real album name from songs[0].album MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The album detail endpoint intentionally 404s (no /api/music/album/:id/detail route), so we fall through to the stub built from songs. The album name is already on every song (Song.album), so use it instead of the literal "专辑". Co-Authored-By: Claude Opus 4.7 (1M context) --- web/src/views/Playlist.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/src/views/Playlist.vue b/web/src/views/Playlist.vue index d00101d..32df56e 100644 --- a/web/src/views/Playlist.vue +++ b/web/src/views/Playlist.vue @@ -107,10 +107,14 @@ onMounted(async () => { if (detail) { playlist.value = detail; } else if (songList.length > 0) { - // Fall back to a stub built from the route + first song's cover. + // Fall back to a stub built from the route + first song. For albums, + // every song's `album` field carries the real album name. + const fallbackName = kind === 'album' + ? (songList[0]?.album || '专辑') + : '歌单'; playlist.value = { id, - name: kind === 'album' ? '专辑' : '歌单', + name: fallbackName, description: '', coverUrl: songList[0]?.coverUrl ?? '', songCount: songList.length,