openvibers/openvibe.mediahub Commits

A recording's channel byline names the channel by its @handle (#381)

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

The watch page channel byline opened the Live channel but showed the display name. It now shows @username, like every other channel name on Video. The avatar initial and the Follow tooltip keep the display name.

Changes

ddiff --git a/server/video/pages.js b/server/video/pages.js
iindex 1a5ba1b..73ffdc8 100644
---- a/server/video/pages.js
++++ b/server/video/pages.js
@@@ -772,7 +772,7 @@ function createVideoRoutes(ctx) {
if (!username) return '';
const channel = `${livePublic}/@${username}`;
const count = Number(followers);
-- return html`<div class="ovv-byline"><a class="ovv-avatar" href="${channel}" aria-hidden="true" tabindex="-1">${String(name || username).slice(0, 1).toUpperCase()}${live.isUsername(String(username)) ? html`<img src="${config.networkUrl}/avatar/${username}" alt="" loading="lazy">` : ''}</a><div class="ovv-byline-text"><a class="ovv-channel-name" href="${channel}">${name || username}</a>${Number.isSafeInteger(count) && count >= 0 ? html`<span class="ovv-meta">${count.toLocaleString('en-US')} ${count === 1 ? 'follower' : 'followers'}</span>` : ''}</div><a class="ovv-btn ovv-follow" href="${channel}" title="Follow ${name || username} on OpenVibe.Live"><i class="fa-solid fa-plus" aria-hidden="true"></i> Follow</a></div>`;
++ return html`<div class="ovv-byline"><a class="ovv-avatar" href="${channel}" aria-hidden="true" tabindex="-1">${String(name || username).slice(0, 1).toUpperCase()}${live.isUsername(String(username)) ? html`<img src="${config.networkUrl}/avatar/${username}" alt="" loading="lazy">` : ''}</a><div class="ovv-byline-text"><a class="ovv-channel-name" href="${channel}">@${username}</a>${Number.isSafeInteger(count) && count >= 0 ? html`<span class="ovv-meta">${count.toLocaleString('en-US')} ${count === 1 ? 'follower' : 'followers'}</span>` : ''}</div><a class="ovv-btn ovv-follow" href="${channel}" title="Follow ${name || username} on OpenVibe.Live"><i class="fa-solid fa-plus" aria-hidden="true"></i> Follow</a></div>`;
};
const watchMore = ({ path, manageable, kind, id, items }) => actionMenu({ icon: 'fa-solid fa-ellipsis', label: 'More', iconOnly: true, cls: 'ovv-more-menu', body: html`<div class="ovv-more-actions"><button type="button" data-ovv-copy-time="${base}${path}"><i class="fa-regular fa-copy" aria-hidden="true"></i> Copy link at time</button><button type="button" data-ovv-pip hidden><i class="fa-regular fa-window-restore" aria-hidden="true"></i> Picture in picture</button><a href="mailto:[email protected]?subject=${encodeURIComponent(`Report ${kind} ${base}${path}`)}"><i class="fa-regular fa-flag" aria-hidden="true"></i> Report</a>${manageable ? html`${editButton(kind === 'clip' ? 'clip' : 'recording')}${deleteAction({ action: `/${kind === 'clip' ? 'c' : 'v'}/${id}`, what: kind === 'clip' ? 'clip' : 'recording' })}` : ''}${menuLinks(items)}</div>` });
const watchFacts = (views, date, duration, visibility) => {
ddiff --git a/test/video-outcomes.test.js b/test/video-outcomes.test.js
iindex 69a7b11..ca17a70 100644
---- a/test/video-outcomes.test.js
++++ b/test/video-outcomes.test.js
@@@ -119,7 +119,7 @@ function startLive() {
assert.ok(line.includes('1,204 views'), 'its views: ' + line);
assert.ok(r.text.includes('Oct 12, 2026'), 'the stream date remains on the page');
// The channel is in the byline under it, and the category in About: nothing is said twice.
-- assert.ok(r.text.includes('class="ovv-channel-name"') && r.text.includes('>Streamer</a>'), 'the channel');
++ assert.ok(r.text.includes('class="ovv-channel-name"') && r.text.includes('>@streamer</a>'), 'the channel is named by its @handle');
assert.ok(r.text.includes("Streamed live on") && r.text.includes('in Gaming'), 'the category is in About');
});