Banner Spin: the owner (ADMIN_EMAIL) skips the tier's Banner Spin count cap (Marty 2026-11-09, like the upload cap exemption); members unchanged

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-09 08:11:19 -06:00
parent f38e8f798b
commit 81f1a96df1
+2 -1
View File
@@ -199,8 +199,9 @@ function pub(s, extra) {
}
async function list(owner) { return mine(owner).map(s => pub(s)); }
async function create(owner, body) {
// the owner (ADMIN_EMAIL) has no Banner Spin count cap (Marty 2026-11-09, same as the upload exemption); members keep their tier's count
const t = await tierFor(owner); if (!t.ok) return { error: t.reason, tier: t };
if (mine(owner).length >= t.spins) return { error: 'Your ' + t.label + ' tier holds ' + t.spins + ' Banner Spins.' + (t.next ? ' ' + t.next.label + ' (' + t.next.need + ') holds ' + t.next.spins + '.' : ''), tier: t };
if (!(ADMIN && norm(owner) === ADMIN) && mine(owner).length >= t.spins) return { error: 'Your ' + t.label + ' tier holds ' + t.spins + ' Banner Spins.' + (t.next ? ' ' + t.next.label + ' (' + t.next.need + ') holds ' + t.next.spins + '.' : ''), tier: t };
const name = String(body.name || '').trim().slice(0, 80); if (!name) return { error: 'Give the Banner Spin a name.' };
const size = String(body.size || ''); if (!SIZES[size]) return { error: 'Pick one of the sizes: ' + Object.keys(SIZES).join(', ') + '.' };
const s = { id: J.db.spins.reduce((m, x) => Math.max(m, x.id), 0) + 1, owner: norm(owner), name, code: newCode(), size, mode: body.mode === 'visitor' ? 'visitor' : 'weight', fallback: httpsUrl(body.fallback) || '', fallbackImage: '', banners: [], nextBanner: 1, paused: false, created: Date.now() };