openvibers/openvibe.report Commits

An after-show report names the channel by its @handle (#179)

OP OpenVibers committed 3 days ago · c04eed0e01 · 2 files, +2 −2

The recap page's channel link opened /@username but showed the display name. It now shows @username.

Changes

ddiff --git a/server/views/index.js b/server/views/index.js
iindex 21277d3..fc6ab8d 100644
---- a/server/views/index.js
++++ b/server/views/index.js
@@@ -537,7 +537,7 @@ function recap({ recap: d } = {}) {
const takes = (r.takes || []).filter((t) => t && t.title).sort((a, b) => (n(a.sec) ?? 1e9) - (n(b.sec) ?? 1e9)).slice(0, 8);
const at = (sec) => (vod && vod.id && n(sec) != null ? `https://openvibe.video/v/${encodeURIComponent(vod.id)}?t=${Math.max(0, Math.floor(Number(sec)))}` : null);
const body = `<header class="rp-page-h rp-recap-h"><p class="rp-kicker">After-show report</p><h1>${esc(w.headline || s.title || 'Stream')}</h1>
--<p class="rp-meta">${kit.mark({ name: who(u), src: u.avatar_url, size: 28 })} <a href="https://openvibe.live/@${encodeURIComponent(u.username || '')}">${esc(who(u))}</a>${s.title && w.headline ? ` · ${esc(s.title)}` : ''}${s.started_at ? ` · ${esc(dayTime(s.started_at))}` : ''}${n(s.duration_seconds) ? ` · ${esc(mins(s.duration_seconds))}` : ''}</p>
++<p class="rp-meta">${kit.mark({ name: who(u), src: u.avatar_url, size: 28 })} <a href="https://openvibe.live/@${encodeURIComponent(u.username || '')}">@${esc(u.username || '')}</a>${s.title && w.headline ? ` · ${esc(s.title)}` : ''}${s.started_at ? ` · ${esc(dayTime(s.started_at))}` : ''}${n(s.duration_seconds) ? ` · ${esc(mins(s.duration_seconds))}` : ''}</p>
${w.summary ? `<p class="rp-summary">${esc(w.summary)}</p><p class="rp-meta">${AI}</p>` : ''}</header>
<section class="rp-tiles" aria-label="The stream in numbers">
${tile('Peak viewers', n(s.peak_viewers) != null ? exact(s.peak_viewers) : null, v.peak_at ? esc(dayTime(v.peak_at)) : '')}
ddiff --git a/test/pages.test.js b/test/pages.test.js
iindex d7c9206..7ff3371 100644
---- a/test/pages.test.js
++++ b/test/pages.test.js
@@@ -17,7 +17,7 @@ const { boot, check, done, defaults } = require('./helpers/boot');
['/rundown/t/seattle', ['Seattle', 'A headline', 'A take']],
['/rundown/e/7', ['A written-up stream', 'The logline.', 'A segment']],
['/rundown/s/goosely', ['goosely', 'A written-up stream', 'Seattle']],
-- ['/after-show/7', ['Seattle Today', 'After-show report']],
++ ['/after-show/7', ['Seattle Today', 'After-show report', '>@goosely</a>']],
['/c/goosely', ['goosely', 'Seattle Today', 'A tiny but mighty vibe', 'Grade A']],
];
for (const [path, expected] of pages) {