fix(spotify): artist split + playlist cover in downloads

navidromeArtist: replace ', ' with ' / ' so Navidrome splits
multi-artist strings (e.g. 'Artist A, Artist B' → 'Artist A / Artist B')
with existing Tags.artist.Split = ["/"] config.

Playlist tracks: remove playlist cover URL as defaultArt in _spTrackItem
so that songs where iTunes lookup fails get no embedded artwork instead
of the wrong playlist cover art.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-04-27 18:58:27 +02:00
1 parent e31ddec843
commit 2c7a04c2bd
1 file changed
+7 -5
+7 -5
View File
@@ -56,14 +56,15 @@ function sanitize(s) {
return (s || 'Unknown').replace(/[\\/:*?"<>|]/g, '_').trim().slice(0, 100);
}
// Convert "Artist feat. B" / "Artist ft. B" / "Artist featuring B" → "Artist / B"
// so Navidrome splits on "/" and lists each as a separate artist
// Convert multi-artist strings to " / " separator so Navidrome splits correctly.
// Handles: "feat." / "ft." / "featuring" and comma-separated artists from Spotify/iTunes.
function navidromeArtist(name) {
if (!name) return name;
return name
.replace(/\s+feat\.?\s+/gi, ' / ')
.replace(/\s+ft\.?\s+/gi, ' / ')
.replace(/\s+featuring\s+/gi, ' / ');
.replace(/\s+featuring\s+/gi, ' / ')
.replace(/,\s+/g, ' / '); // "Artist A, Artist B" → "Artist A / Artist B"
}
function updateJob(id, update) {
@@ -548,8 +549,9 @@ app.post('/api/spotify/resolve', async (req, res) => {
artist: owner,
artworkUrl: artUrl,
description: entity.description || '',
// pass artUrl as defaultArt so tracks show the playlist cover when no per-track art exists
tracks: trackList.map(t => _spTrackItem(t, null, artUrl, null)),
// no defaultArt for playlist tracks — iTunes lazy-loader will fill correct per-track art;
// passing playlist cover here would cause it to be embedded in downloads for unresolved tracks
tracks: trackList.map(t => _spTrackItem(t, null, null, null)),
});
}