fix(backend): keep source artist name as-is, no iTunes override
Artist name from Spotify/source is stored directly in folder, filename, and tags without being replaced by the iTunes artistName. iTunes is used only for supplemental metadata (genre, year, cover, duration, trackNum, albumArtist/collectionArtistName). Sort tags still receive romaji via romajiForStorage() in ytdlp.js. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
ff79428683
commit
1616d98fa6
1 file changed
+7
-8
@@ -600,8 +600,8 @@ app.post('/api/download', async (req, res) => {
|
||||
if (!meta.trackNum && genreMeta.trackNum) { meta.trackNum = genreMeta.trackNum; }
|
||||
}
|
||||
}
|
||||
const finalArtist = meta.itunesArtistName || artist;
|
||||
const result = await downloadTrack({ jobId, artist: finalArtist, rawArtist: artist, title, ...meta, sourceUrl: sourceUrl || sp.sourceUrl || undefined });
|
||||
// Keep source (Spotify) artist name as-is — no iTunes override
|
||||
const result = await downloadTrack({ jobId, artist, rawArtist: artist, title, ...meta, sourceUrl: sourceUrl || sp.sourceUrl || undefined });
|
||||
if (result?.skipped) {
|
||||
updateJob(jobId, { status: 'done', progress: 100, message: 'Bereits vorhanden – übersprungen', skipped: true });
|
||||
} else if (result?.notFound) {
|
||||
@@ -688,14 +688,13 @@ app.post('/api/download', async (req, res) => {
|
||||
log(jobId, `📋 iTunes: "${trackArtist} – ${trackTitle}"`);
|
||||
itunes = await lookupItunesTrackMeta(searchArtist, itunesTitle);
|
||||
}
|
||||
// Prefer iTunes-resolved name (from server lookup or frontend enrichment) for sort tags / folders.
|
||||
// trackArtist stays as rawArtist for main tags and YTM search.
|
||||
const resolvedArtist = itunes.itunesArtistName || track.itunesArtistName || trackArtist;
|
||||
// Keep source (Spotify) artist name as-is — no iTunes override.
|
||||
// iTunes collectionArtistName is used as albumArtist for consistent album grouping.
|
||||
return downloadTrack({
|
||||
jobId,
|
||||
artist: resolvedArtist, // iTunes English name → used for sort tags + folder names
|
||||
rawArtist: trackArtist, // original Spotify/Japanese name → used for main tag + YTM search
|
||||
albumArtist: resolvedArtist,
|
||||
artist: trackArtist,
|
||||
rawArtist: trackArtist,
|
||||
albumArtist: itunes.albumArtist || trackArtist,
|
||||
title: trackTitle,
|
||||
album: itunes.album || track.collectionName || track.album || '',
|
||||
year: itunes.year || (track.releaseDate ? new Date(track.releaseDate).getFullYear() : undefined) || track.year,
|
||||
|
||||
Reference in new issue
Block a user