mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-02 04:52:50 +08:00
fix(web): album hero shows real album name from songs[0].album
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) <noreply@anthropic.com>
This commit is contained in:
1 parent
f6b82b8e21
commit
8cccf2ed24
1 file changed
+6
-2
@@ -107,10 +107,14 @@ onMounted(async () => {
|
|||||||
if (detail) {
|
if (detail) {
|
||||||
playlist.value = detail;
|
playlist.value = detail;
|
||||||
} else if (songList.length > 0) {
|
} 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 = {
|
playlist.value = {
|
||||||
id,
|
id,
|
||||||
name: kind === 'album' ? '专辑' : '歌单',
|
name: fallbackName,
|
||||||
description: '',
|
description: '',
|
||||||
coverUrl: songList[0]?.coverUrl ?? '',
|
coverUrl: songList[0]?.coverUrl ?? '',
|
||||||
songCount: songList.length,
|
songCount: songList.length,
|
||||||
|
|||||||
Reference in new issue
Block a user