fix: normalize diacritics in playlist artist matching
Use Unicode property escapes to strip only symbols (☆, !, etc.) while keeping Unicode letters (ø, ä, é) — fixes "Kløn" becoming "Kln" instead of staying "Kløn" in the search query. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
afcbf81547
commit
c1a740240a
1 file changed
+2
-2
@@ -242,8 +242,8 @@ async function downloadTrack({ jobId, artist, albumArtist, title, album, year, t
|
||||
}
|
||||
|
||||
const outputTemplate = path.join(dir, `${trackPrefix}${safeTitle}.%(ext)s`);
|
||||
// Strip non-ASCII chars (e.g. ☆) from artist name for cleaner search ranking
|
||||
const searchArtist = mainArtist.replace(/[^\x00-\x7F]/g, '').trim();
|
||||
// Strip symbol chars (e.g. ☆) but keep Unicode letters like ø, ä, é
|
||||
const searchArtist = mainArtist.replace(/[^\p{L}\p{N}\s,&\-]/gu, '').trim();
|
||||
const query = `${searchArtist} - ${title}`;
|
||||
|
||||
// Step 1: yt-dlp — audio only, no thumbnail (we embed iTunes artwork ourselves)
|
||||
|
||||
Reference in new issue
Block a user