fix: use Navidrome's resolved artists array instead of splitting on /
Manual split on / broke artist names like HUNTR/X and Au/Ra. Now uses s.artists (OpenSubsonic array with correct IDs per artist) and falls back to s.artist as a single unsplit link. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
4f83eebe79
commit
7b4e221881
1 file changed
+7
-7
+7
-7
@@ -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.className = 'song-item' + (S.queue[S.qIdx]?.id === s.id ? ' playing' : '');
|
||||||
el.dataset.songId = s.id;
|
el.dataset.songId = s.id;
|
||||||
const cv = coverUrl(s.coverArt, 128);
|
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
|
const artistHtml = artistParts.length
|
||||||
? artistParts.map((name, i) => {
|
? artistParts.map(a => noArtistLink
|
||||||
const aid = i === 0 ? (s.artistId || '') : '';
|
? `<span style="color:var(--text2)">${esc(a.name)}</span>`
|
||||||
return noArtistLink
|
: `<span class="song-link" onclick="event.stopPropagation();s_goArtist(event,'${esc(a.name)}','${a.id||''}')">${esc(a.name)}</span>`
|
||||||
? `<span style="color:var(--text2)">${esc(name)}</span>`
|
).join('<span style="color:var(--text3)"> • </span>')
|
||||||
: `<span class="song-link" onclick="event.stopPropagation();s_goArtist(event,'${esc(name)}','${aid}')">${esc(name)}</span>`;
|
|
||||||
}).join('<span style="color:var(--text3)"> • </span>')
|
|
||||||
: '';
|
: '';
|
||||||
const albumHtml = !noAlbumLink && (s.albumId||s.album)
|
const albumHtml = !noAlbumLink && (s.albumId||s.album)
|
||||||
? `<span style="color:var(--text3)"> · </span><span class="song-link" onclick="event.stopPropagation();s_goAlbum(event,'${s.albumId||''}','${esc(s.album||'')}','${esc(s.artist||'')}','${s.artistId||''}')">${esc(s.album||'')}</span>`
|
? `<span style="color:var(--text3)"> · </span><span class="song-link" onclick="event.stopPropagation();s_goAlbum(event,'${s.albumId||''}','${esc(s.album||'')}','${esc(s.artist||'')}','${s.artistId||''}')">${esc(s.album||'')}</span>`
|
||||||
|
|||||||
Reference in new issue
Block a user