diff --git a/src/enrich/enrichment.service.ts b/src/enrich/enrichment.service.ts index 3353ef7..327eb49 100644 --- a/src/enrich/enrichment.service.ts +++ b/src/enrich/enrichment.service.ts @@ -180,7 +180,13 @@ export class EnrichmentService { genre: string | null; } | null> { try { - const term = encodeURIComponent(`${artist} ${song}`.trim()); + // Пунктуация в названии («St.Thomas», «feat.») ломает поиск iTunes — + // заменяем все не-буквенно-цифровые символы на пробел и схлопываем. + const clean = `${artist} ${song}` + .replace(/[^\p{L}\p{N}]+/gu, ' ') + .replace(/\s+/g, ' ') + .trim(); + const term = encodeURIComponent(clean); const url = `https://itunes.apple.com/search?term=${term}&entity=song&limit=1`; const res = await fetch(url, { headers: { 'User-Agent': 'radiOLA/1.0 +https://radiola.app' },