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