fix: consistent artist parsing across player, NP overlay, and song list
Extract parseArtists() helper — uses Navidrome's resolved artists array when it has multiple entries, otherwise splits artist string on ';' only. Removes old split on / that broke Au/Ra, HUNTR/X etc everywhere. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
7b4e221881
commit
467ee8a0fe
2 files changed
+16
-14
No files matched your search
+2
-4
@@ -2,7 +2,7 @@ import { S } from './state.js';
|
||||
import { esc, formatDur } from './utils.js';
|
||||
import { coverUrl } from './api.js';
|
||||
// Circular imports — safe (only used inside event handlers after module init)
|
||||
import { playQueue, toggleStar, playPreview } from './player.js';
|
||||
import { playQueue, toggleStar, playPreview, parseArtists } from './player.js';
|
||||
import { showCtxMenu, openDlModal } from './ui.js';
|
||||
import { navigate, quickPlayAlbum, quickPlayArtist } from './views.js';
|
||||
|
||||
@@ -33,9 +33,7 @@ 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 = Array.isArray(s.artists) && s.artists.length
|
||||
? s.artists
|
||||
: s.artist ? [{ name: s.artist, id: s.artistId || '' }] : [];
|
||||
const artistParts = parseArtists(s);
|
||||
const artistHtml = artistParts.length
|
||||
? artistParts.map(a => noArtistLink
|
||||
? `<span style="color:var(--text2)">${esc(a.name)}</span>`
|
||||
|
||||
Reference in new issue
Block a user