bugfix-9
All checks were successful
release-tag / release-image (push) Successful in 2m1s

This commit is contained in:
2025-09-21 21:28:10 +02:00
parent 73286479cb
commit b2e7515327
2 changed files with 44 additions and 10 deletions

View File

@@ -46,12 +46,19 @@
const apiLive = !!it.live;
const pillClass = apiLive ? 'live' : 'off';
const pillText = apiLive ? 'LIVE' : 'Offline';
const viewers = (()=>{
const cands = [it.viewers, it.viewerCount, it.viewCount, it.watchers, it.clients, it.hls_viewers, it.stats && it.stats.viewers];
for (const v of cands){
const n = typeof v === 'string' ? parseInt(v,10) : v;
if (Number.isFinite(n) && n >= 0) return n;
}
return 0;
})();
a.innerHTML = `
<div class="row space-between">
<div>
<div class="title-strong">${it.name}</div>
<div class="muted">Zuschauer: ${it.viewers ?? 0}</div>
<div class="muted">Zuschauer: ${viewers}</div>
</div>
<div class="pill ${pillClass}" data-role="live-pill">${pillText}</div>
</div>`;