fix: handle iTunes rate-limit empty responses, reduce Spotify artwork concurrency

- itunesSearch: use r.text() + JSON.parse so empty body (rate-limit) returns [] instead of throwing
- reduce Spotify artwork batch size 8→4 to avoid hammering iTunes and affecting global search

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-04-28 00:54:53 +02:00
1 parent a61436669e
commit 2b6870583b
2 files changed
+7 -4

No files matched your search

+1 -1
View File
@@ -172,7 +172,7 @@ async function _loadSpotifyTrackArtwork(tracks, listEl) {
});
// Enrich each track with iTunes data — same call as global search
const CONC = 8;
const CONC = 4;
for (let i = 0; i < tracks.length; i += CONC) {
const batch = tracks.slice(i, i + CONC);
await Promise.all(batch.map(async (t, bi) => {