fix(spotify): use ', ' as artist separator (iTunes/Spotify standard)
User will add ', ' to Navidrome's Tags.artist.Split config. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
a5e38e64cf
commit
74743a81e6
1 file changed
+2
-4
@@ -439,8 +439,7 @@ function _spAllArtists(artistsRaw) {
|
|||||||
if (!artistsRaw) return '';
|
if (!artistsRaw) return '';
|
||||||
// Handle both array format and GraphQL {items:[...]} format
|
// Handle both array format and GraphQL {items:[...]} format
|
||||||
const arr = Array.isArray(artistsRaw) ? artistsRaw : (artistsRaw.items || []);
|
const arr = Array.isArray(artistsRaw) ? artistsRaw : (artistsRaw.items || []);
|
||||||
// Use " / " so Navidrome splits on "/" into multiple artists
|
return arr.map(a => a?.profile?.name || a?.name || '').filter(Boolean).join(', ');
|
||||||
return arr.map(a => a?.profile?.name || a?.name || '').filter(Boolean).join(' / ');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function _spArtistName(artistsRaw) {
|
function _spArtistName(artistsRaw) {
|
||||||
@@ -462,8 +461,7 @@ function _spTrackItem(t, defaultAlbum, defaultArt, defaultAlbumArtist) {
|
|||||||
if (d?.artists) {
|
if (d?.artists) {
|
||||||
artist = _spAllArtists(d.artists);
|
artist = _spAllArtists(d.artists);
|
||||||
} else if (typeof d?.subtitle === 'string' && d.subtitle) {
|
} else if (typeof d?.subtitle === 'string' && d.subtitle) {
|
||||||
// Spotify subtitle separates artists with ", " — convert to " / " for Navidrome splitting
|
artist = d.subtitle; // already comma-separated, matches iTunes/Spotify standard
|
||||||
artist = d.subtitle.replace(/,\s*/g, ' / ');
|
|
||||||
}
|
}
|
||||||
artist = artist || defaultAlbumArtist || '';
|
artist = artist || defaultAlbumArtist || '';
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user