openvibers/openvibe.live Commits

Hero deltas: leave hours-watched alone in the live poller

OP OpenVibers committed 16 Sept 2026 · 651dac42ff · 3 files, +9 −3

Its 7-day figure comes from OpenVibe.Media, which is where VODs live; the local database knows
only zero. The poller was about to overwrite a correct value with a wrong one every ten seconds.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CMxJm1dB8rdsaMSgNjVa82

Changes

ddiff --git a/public/index.html b/public/index.html
iindex 766820c4..ff1a4f86 100644
---- a/public/index.html
++++ b/public/index.html
@@@ -5130,7 +5130,7 @@ curl -s https://openvibe.media/live/@Goosely/chat-insight.json | jq ".chat_insig
<script src="/live-notify.js?v=3" defer></script>
<script src="/js/ov-skeleton.js?v=1" defer></script>
<script src="/js/ov-odometer.js?v=3" defer></script>
--<script src="/js/app.js?v=157" defer></script>
++<script src="/js/app.js?v=158" defer></script>
<script src="/js/stream-player.js?v=22" defer></script>
<script src="/js/stream-pip.js?v=1" defer></script>
<script src="/js/chat-shared.js?v=3" defer></script>
ddiff --git a/public/js/app.js b/public/js/app.js
iindex 19ab9cfd..07d7f2fc 100644
---- a/public/js/app.js
++++ b/public/js/app.js
@@@ -1598,8 +1598,11 @@ function _startHeroStatsLive() {
// Deltas move too — refresh them in place rather than rebuilding the chip.
const DELTA_FOR = {
users: d.recent?.users, anons: d.recent?.anons,
-- chatMessages: d.recent?.messages, hoursWatched: d.recent?.hours,
++ chatMessages: d.recent?.messages,
streamers: d.recent?.streamers,
++ // hoursWatched is deliberately absent: its 7-day figure comes from OpenVibe.Media
++ // (that is where VODs live now), and this endpoint only knows the local number,
++ // which is zero. Overwriting it here would wipe a correct value with a wrong one.
weeklyActive: { w: d.weeklyActive, pw: d.prevWeeklyActive },
weeklyVisitors: { w: d.weeklyVisitors, pw: d.prevWeeklyVisitors },
};
ddiff --git a/server/home/routes.js b/server/home/routes.js
iindex baee9b68..08533717 100644
---- a/server/home/routes.js
++++ b/server/home/routes.js
@@@ -225,8 +225,11 @@ router.get('/stats-live', (req, res) => {
prevWeeklyVisitors: s.prevWeeklyVisitors, prevWeeklyActive: s.prevWeeklyActive,
recent: {
users: s.recent?.users, anons: s.recent?.anons,
-- messages: s.recent?.messages, hours: s.recent?.hours,
++ messages: s.recent?.messages,
streamers: s.recent?.streamers,
++ // No `hours` here on purpose — the real figure comes from OpenVibe.Media and is
++ // merged into the hero payload; the local number is zero and would be wrong.
++
},
};
_liveStats = { at: Date.now(), data };