diff --git a/src/components.js b/src/components.js index fbf1f3d..f97bded 100644 --- a/src/components.js +++ b/src/components.js @@ -33,14 +33,14 @@ export function makeSongItem(s, idx, list, { noArtistLink = false, noAlbumLink = el.className = 'song-item' + (S.queue[S.qIdx]?.id === s.id ? ' playing' : ''); el.dataset.songId = s.id; const cv = coverUrl(s.coverArt, 128); - const artistParts = (s.artist || '').split(/\s*(?:\/|•|,)\s*/).filter(Boolean); + const artistParts = Array.isArray(s.artists) && s.artists.length + ? s.artists + : s.artist ? [{ name: s.artist, id: s.artistId || '' }] : []; const artistHtml = artistParts.length - ? artistParts.map((name, i) => { - const aid = i === 0 ? (s.artistId || '') : ''; - return noArtistLink - ? `${esc(name)}` - : `${esc(name)}`; - }).join(' • ') + ? artistParts.map(a => noArtistLink + ? `${esc(a.name)}` + : `${esc(a.name)}` + ).join(' • ') : ''; const albumHtml = !noAlbumLink && (s.albumId||s.album) ? ` · ${esc(s.album||'')}`