Files
pauljdandClaude Opus 5.5 934f82d805
pauljd/davidson-ci: Davidson CI / quality (push) Failing after 1m48s
pauljd/davidson-ci: Davidson CI / ai-review (push) Successful in 49s
Orbit TV at 0.16.0-tuning-screen
First commit, imported from the working folder: Android TV app, loopback
guide server, design sources and per-release verification notes.

Includes the 0.16 tuning screen, built and tested but not yet confirmed
on the box.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-01 17:25:30 +00:00

19 lines
1.3 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export const SLOT_MS = 30 * 60 * 1000;
export const channels = [
{ number: 101, name: 'Orbit One', titles: ['The Midnight Observatory', 'Small Town, Big Orbit', 'Beyond the Blue', 'The Last Shuttle Home'] },
{ number: 202, name: 'Orbit Sci-Fi', titles: ['Signal from Europa', 'Starbound Dispatch', 'Visitors at Dawn', 'Station Nine'] },
{ number: 401, name: 'Orbit Kids', titles: ['Moonbug Rangers', 'The Comet Club', 'Rocket Pocket', 'Planet of Puzzles'] },
];
export function programme(channel: typeof channels[number], time: number) {
if (!Number.isSafeInteger(time) || Math.abs(time) > 8e15) throw new RangeError('Invalid timestamp');
const slot = Math.floor(time / SLOT_MS);
const index = ((slot % channel.titles.length) + channel.titles.length) % channel.titles.length;
const start = slot * SLOT_MS;
return { title: channel.titles[index], start, end: start + SLOT_MS, offsetMs: time - start };
}
export function guide(time = Date.now(), count = 6) {
if (!Number.isInteger(count) || count < 1 || count > 48) throw new RangeError('count must be 1–48');
return channels.map(channel => ({ number: channel.number, name: channel.name,
programmes: Array.from({ length: count }, (_, i) => ({ ...programme(channel, time + i * SLOT_MS), offsetMs: i === 0 ? programme(channel, time).offsetMs : 0 })) }));
}