change: Konzerte ohne Zeitfenster — Chips nur noch bei den Veroeffentlichungen
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
17a677a5a5
commit
ae357b0eb9
9 files changed
+66
-48
No files matched your search
@@ -265,7 +265,10 @@ app.post('/api/artist-concerts', async (req, res) => {
|
||||
if (!key) return res.json({ konzerte: [], ohneTermine: [], keinSchluessel: true });
|
||||
|
||||
const artists = Array.isArray(req.body?.artists) ? req.body.artists : [];
|
||||
const days = Math.min(Math.max(parseInt(req.body?.days, 10) || 365, 1), 365);
|
||||
// Ohne `days` gibt es KEIN Fenster — Konzerte sind ohnehin nur Zukunft, und dort will man
|
||||
// alles Angekuendigte sehen. Ein mitgeschicktes Fenster wird weiterhin beachtet.
|
||||
const roh = parseInt(req.body?.days, 10);
|
||||
const days = Number.isFinite(roh) && roh > 0 ? Math.min(roh, 3650) : 0;
|
||||
if (!artists.length) return res.json({ konzerte: [], ohneTermine: [] });
|
||||
// Obergrenze, damit ein kaputter Client nicht hunderte Ticketmaster-Aufrufe ausloest.
|
||||
if (artists.length > 300) return res.status(400).json({ error: 'Zu viele Künstler (max. 300)' });
|
||||
|
||||
Reference in new issue
Block a user