diff --git a/backend/novasonic-server.js b/backend/novasonic-server.js index 337ff17..8371064 100644 --- a/backend/novasonic-server.js +++ b/backend/novasonic-server.js @@ -276,6 +276,9 @@ app.post('/api/spotify/resolve', async (req, res) => { res.status(400).json({ error: `Unbekannter Typ: ${type}` }); } catch(e) { console.error('[spotify/resolve]', e.message); + if (e.message.includes('403') && e.message.includes('/playlists/')) { + return res.status(403).json({ error: 'EDITORIAL_PLAYLIST' }); + } res.status(500).json({ error: e.message }); } }); diff --git a/src/spotify.js b/src/spotify.js index 287e2d0..709d428 100644 --- a/src/spotify.js +++ b/src/spotify.js @@ -66,13 +66,31 @@ export async function resolveSpotifyLink() { }); if (!res.ok) { const err = await res.json().catch(() => ({})); - throw new Error(err.error || `HTTP ${res.status}`); + if (err.error === 'EDITORIAL_PLAYLIST') throw new Error('EDITORIAL_PLAYLIST'); + throw new Error(err.error || err.message || `HTTP ${res.status}`); } const data = await res.json(); window._spotifyResolved = data; if (data.skippedLocal > 0) toast(`${data.skippedLocal} lokale Datei(en) übersprungen (kein Stream verfügbar)`); _renderSpotifyPreview(data); } catch(e) { + if (e.message === 'EDITORIAL_PLAYLIST') { + inner.innerHTML = `