pco-plan: timers say when a service began and when the live item is stale
A running service with no live item (not following ProPresenter, nothing matched yet) now reports "Started 9:00 AM" instead of an empty status, and the current-item timer is muted and flagged "ProPresenter unreachable" while the feed or ProPresenter is down — it keeps counting the last item we knew of, but the wall can tell it is stale. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
49b7e46d0c
commit
820df909bf
@@ -822,8 +822,11 @@ module.exports = {
|
|||||||
service.state = 'running';
|
service.state = 'running';
|
||||||
service.startedAt = svc.startedAt;
|
service.startedAt = svc.startedAt;
|
||||||
service.elapsedMs = elapsed;
|
service.elapsedMs = elapsed;
|
||||||
|
// The live item is the headline; without one (not following
|
||||||
|
// ProPresenter, nothing matched yet) say how far behind, else when
|
||||||
|
// the service began.
|
||||||
service.status = {
|
service.status = {
|
||||||
text: itemTitle || (behind >= BEHIND_WARN_MS ? `Behind ${fmtDur(behind)}` : ''),
|
text: itemTitle || (behind >= BEHIND_WARN_MS ? `Behind ${fmtDur(behind)}` : `Started ${fmtTime(svc.startedAt)}`),
|
||||||
tone: serviceTone(elapsed, plannedMs, behind),
|
tone: serviceTone(elapsed, plannedMs, behind),
|
||||||
};
|
};
|
||||||
service.detail = [label, itemDetail].filter(Boolean).join(' · ');
|
service.detail = [label, itemDetail].filter(Boolean).join(' · ');
|
||||||
@@ -851,11 +854,14 @@ module.exports = {
|
|||||||
currentItem.startedAt = hist.startedAt;
|
currentItem.startedAt = hist.startedAt;
|
||||||
currentItem.elapsedMs = elapsed;
|
currentItem.elapsedMs = elapsed;
|
||||||
currentItem.targetMs = planned || null;
|
currentItem.targetMs = planned || null;
|
||||||
|
// With ProPresenter (or its module) unreachable this is the last item
|
||||||
|
// we knew of — still counting, but muted so the wall says "stale".
|
||||||
|
const stale = !live.available || !live.ppReachable;
|
||||||
currentItem.status = {
|
currentItem.status = {
|
||||||
text: itemTitle,
|
text: itemTitle,
|
||||||
tone: over > planned * 0.25 + 30000 ? 'danger' : over > 0 ? 'warn' : 'ok',
|
tone: stale ? 'muted' : over > planned * 0.25 + 30000 ? 'danger' : over > 0 ? 'warn' : 'ok',
|
||||||
};
|
};
|
||||||
currentItem.detail = itemDetail;
|
currentItem.detail = stale ? `${itemDetail} · ProPresenter unreachable` : itemDetail;
|
||||||
} else {
|
} else {
|
||||||
currentItem.status = {
|
currentItem.status = {
|
||||||
text: !live.following ? 'Not following ProPresenter' : !live.available ? 'ProPresenter feed unavailable' : 'Nothing live',
|
text: !live.following ? 'Not following ProPresenter' : !live.available ? 'ProPresenter feed unavailable' : 'Nothing live',
|
||||||
|
|||||||
Reference in New Issue
Block a user