diff --git a/backend/novasonic-server.js b/backend/novasonic-server.js index 28d0f11..a339efc 100644 --- a/backend/novasonic-server.js +++ b/backend/novasonic-server.js @@ -190,9 +190,10 @@ app.post('/api/spotify/track-artwork', async (req, res) => { }); // ─── ITUNES METADATA LOOKUP (must be before the proxy route) ───────────────── -app.get('/api/itunes/lookup', async (req, res) => { +app.get('/api/itunes/lookup', async (req, res, next) => { const { artist, title } = req.query; - if (!artist || !title) return res.status(400).json({ error: 'artist and title required' }); + // ID-based lookups (?id=...) are not for track meta — let them fall through to the proxy. + if (!artist || !title) return next(); try { const meta = await lookupItunesTrackMeta(artist, title); if (!meta.album && !meta.genre && !meta.year) return res.json({ found: false });