restyling

This commit is contained in:
2026-01-23 19:16:21 +01:00
parent 138136e835
commit 1394ef6f67
12 changed files with 804 additions and 238 deletions

View File

@@ -19,6 +19,8 @@
const stage = document.getElementById('stage');
const notice = document.getElementById('notice');
const isPreview = new URLSearchParams(window.location.search).get('preview') === '1';
// Stable session id per browser (used to enforce max concurrent viewers per display token)
const SID_KEY = `display_sid_${token}`;
function getSid() {
@@ -31,14 +33,15 @@
return sid;
}
const sid = getSid();
const sid = isPreview ? null : getSid();
let playlist = null;
let idx = 0;
let timer = null;
async function fetchPlaylist() {
const res = await fetch(`/api/display/${token}/playlist?sid=${encodeURIComponent(sid)}`, { cache: 'no-store' });
const qs = sid ? `?sid=${encodeURIComponent(sid)}` : '';
const res = await fetch(`/api/display/${token}/playlist${qs}`, { cache: 'no-store' });
if (res.status === 429) {
const data = await res.json().catch(() => null);
throw Object.assign(new Error(data?.message || 'Display limit reached'), { code: 'LIMIT', data });