'更新'
This commit is contained in:
+10
-1
@@ -61,6 +61,12 @@ async function fetchNeteaseAlbumDetail(albumId) {
|
||||
const data = await requestNetease(`/api/v1/album/${albumId}`);
|
||||
if (!data) return null;
|
||||
const album = data.album || data;
|
||||
const albumArtists = (album.artists?.length ? album.artists : [album.artist])
|
||||
.filter(artist => artist?.name)
|
||||
.map(artist => ({ id: artist.id, name: artist.name, trans: artist.trans }));
|
||||
const albumArtist = albumArtists.map(artist => artist.name).join(' / ');
|
||||
const normalizedAlbumArtist = albumArtist.toLowerCase().replace(/[.\s]/g, '');
|
||||
const isCompilation = ['群星', 'variousartists', 'variousartist', 'va'].includes(normalizedAlbumArtist);
|
||||
return {
|
||||
id: album.id,
|
||||
name: album.name,
|
||||
@@ -70,7 +76,10 @@ async function fetchNeteaseAlbumDetail(albumId) {
|
||||
tags: album.tags || [],
|
||||
type: album.type || '',
|
||||
size: album.size || 0,
|
||||
artist: album.artist ? { id: album.artist.id, name: album.artist.name, trans: album.artist.trans } : null,
|
||||
artist: albumArtists[0] || null,
|
||||
artists: albumArtists,
|
||||
albumArtist,
|
||||
isCompilation,
|
||||
picUrl: album.picUrl || '',
|
||||
tracks: (data.songs || album.songs || []).map(song => ({
|
||||
id: song.id,
|
||||
|
||||
Reference in New Issue
Block a user