fix(spotify): use first artist for iTunes search in single-track downloads

Multi-artist strings like "Kløn, Renzyx" from Spotify's subtitle field
confuse the iTunes search API. Use only the first artist (split on comma)
as the search term, same as the playlist path already does.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-04-27 18:30:56 +02:00
1 parent 16cf49638f
commit 9f0cb899ed
1 file changed
+3 -1
+3 -1
View File
@@ -584,8 +584,10 @@ app.post('/api/download', async (req, res) => {
let meta = { album: spAlbum, year: spYear, trackNum: sp.trackNumber || undefined, let meta = { album: spAlbum, year: spYear, trackNum: sp.trackNumber || undefined,
artworkUrl: spArt, explicit: sp.trackExplicitness === 'explicit' || !!explicit }; artworkUrl: spArt, explicit: sp.trackExplicitness === 'explicit' || !!explicit };
if (!meta.album) { if (!meta.album) {
// Use first artist only for iTunes search (multi-artist strings like "Kløn, Renzyx" confuse iTunes)
const searchArtist = artist.split(',')[0].trim();
log(jobId, '📋 Suche Album-Metadaten von iTunes…'); log(jobId, '📋 Suche Album-Metadaten von iTunes…');
const extra = await lookupItunesTrackMeta(artist, title); const extra = await lookupItunesTrackMeta(searchArtist, title);
if (extra.album) log(jobId, `📋 Album: "${extra.album}" (${extra.year || '?'})`); if (extra.album) log(jobId, `📋 Album: "${extra.album}" (${extra.year || '?'})`);
meta = { ...meta, ...extra, artworkUrl: spArt || extra.artworkUrl || '' }; meta = { ...meta, ...extra, artworkUrl: spArt || extra.artworkUrl || '' };
} else { } else {