Phin Tech docs Rabbit Ears Manager in the store →

On Demand through the relay: one catalog, and search

Superseded 2026-11-03. The Swift server (StationServer, RelayServer, antenna-tower-server, control-room, the Manager's launchd helper and MCP assistant) was replaced by the Go tower in tower/ (ADR 0005). What follows is history.

Design agreed 2026-09-28. Nothing here is built yet.

Today each screen fetches On Demand one folder at a time (sources, categories, titles, seasons, episodes) straight from each Xtream login and Plex server, and keeps its own copy on disk (OnDemandCatalog). Nothing knows a title until its category has been opened, so there's nothing to search, and every screen fetches the same catalogs for itself. The relay (docs/manager-relay.md) fetches the catalogs once, holds one index of every title, and answers browsing and search for every screen.

Decisions #

  1. Search from everywhere. On the TV: a Search row at the top of On Demand with a retro letter grid steered by the remote, matches narrowing with each letter. A Keyboard key on the grid (and Play/Pause) opens the tvOS keyboard, for dictation and typing from an iPhone. In the Manager and through the MCP: search, then "play on a screen…".
  2. One entry per title, copies inside it. The same film on several logins (and Plex) is one entry, matched by cleaned name and year (TMDB id where the provider gives one). Play takes the best copy: the preferred login, then Plex, then quality. Select lists each copy (login, 4K/HD/SD from the name, file type) to choose from. The row says so: 1995 · 3 copies · 4K, · Plex when there's a Plex copy, and a mark when every copy is a file AVPlayer can't open (MKV, AVI).
  3. The relay caches the catalog, descriptions and posters. Names, years, categories, which login has what, and the search index, refreshed nightly and from the Manager on demand. Plots (today Synopses, per screen) and posters are fetched once, by the relay, and kept.
  4. Without the relay, browsing works as today and search waits. Screens fall back to fetching folders directly; the Search row says "Search needs the relay (Mac mini)". VOD is served when the Manager hosts the relay (it has the logins and the Plex token); retro-relay alone has no VOD.
  5. Search follows your preferences, not your hand-picked categories. Languages, hidden kinds and hidden sources apply; categories picked to keep the menus short don't, so a film in one you left out still turns up. The Manager and MCP have a "search everything" switch.
  6. Adult never enters the index. A whole-catalog fetch returns every title, adult ones too (a title carries only its category id), so the relay drops titles in categories Adult.category matches, as live channels do (Xtream.allChannels), and in categories Jev tagged adult, whatever the settings say. Nothing can find them: TV, Manager, MCP or "search everything".

The catalog #

The protocol #

Version 1 routes, same token and client tracking as the planes feed:

Request Answer
GET /v1/vod/sources The sources (each login's movies and series, each Plex library).
GET /v1/vod/sources/<id>/categories A source's categories, with their tags.
GET /v1/vod/sources/<id>/categories/<cat> Its titles, merged, each with its copies.
GET /v1/vod/shows/<id> A show's seasons and episodes, each with its copies.
GET /v1/vod/search?q=…&lang=…&hide=…&all=1 Matching titles, best first, at most 50. The screen sends its preferences; all is the Manager's switch.
GET /v1/vod/titles/<id>/plot The description.
GET /v1/vod/titles/<id>/poster The poster, from the relay's cache.

Search matches word prefixes, ignoring case and accents ("dark kn" finds The Dark Knight), ranked: whole name, then name start, then word start, then newer. Play URLs aren't served: the screen builds them from the copy's login as today, so streams don't pass through the Mac mini.

In the code #

Built (2026-09-29) #

Phase 1, with these changes from the plan above:

Not built yet: posters, and "play on a screen…" (screens can't be told to play yet).

Phase 2: downloads into Plex #

(Redesigned 2026-10-17 with playing: see vod-fetch.md. The relay fetches both a play buffer and a kept copy, and streams do pass through the Mac mini.)

(Not the same thing as a screen playing a title while it downloads, which is built: see read-ahead.md. That copy is a buffer and is deleted when the title stops.)

"Download" on a title (or a whole series) has the relay fetch a copy into your Plex library on a shared drive, set in the Plex pane (one folder for movies, one for TV, kept on the relay's Mac only), named as Plex expects: Movies/Heat (1995)/Heat (1995).mkv, TV Shows/Show/Season 01/Show - S01E02.mkv. Then it asks Plex to scan, and the title gains a · Plex copy, first choice from then on. No remuxing: Plex transcodes what AVPlayer can't open. A download takes one of the login's streams while it runs (trex allows one), so downloads queue one at a time per login and wait while that login is playing.

Built: shelves and poster rows (2026-10-12) #

On Demand opens on rows of posters, as a streaming app does, not on the list of logins. Separate from the Video Store (docs/video-store.md), which is its own channel and untouched; they share the poster cache and the relay's poster route.

Built: the filter drawer, and modern lists (2026-10-12) #

Built: watched, other copies, and the card (2026-10-13) #

Built: collections and cast (2026-10-14) #

Designed, not built: a shelf as a channel (2026-10-14) #

Put on hold partway through the design. What was decided: