This commit is contained in:
@@ -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>`;
|
||||
|
||||
Reference in New Issue
Block a user