Auto-tuning: generate channels automatically from library metadata #69

Closed
opened 2026-07-01 23:44:02 +02:00 by timothy · 6 comments
Owner

Concept borrowed from PseudoTV (its signature feature). Relates to the redesign #59 and complements the manual create-channel builder (epic #62) as a second creation mode.

Goal

"Install it and it builds a lineup for you." A wizard that auto-generates whole channels from existing library metadata, so a large library becomes a full channel lineup with little manual work.

Scope

  • Generate a channel per metadata axis: TV Network, TV Show (per-show 24/7), TV Genre, Movie Genre, Movie Studio, Mixed Genre, Music Genre, Smart Collection, Mixed Content.
  • Preview the generated channels before committing; let the user select which to keep and bulk-create.
  • Reuse existing primitives: ErsatzTV already has Collections, Smart Collections, and genre/studio/network filtering — this is largely orchestration over them (create Collection + Schedule + Playout per generated channel).
  • Sensible defaults via the Channel Template system (#64).

Why

The single biggest concept PseudoTV has that ErsatzTV lacks. Establishes the "automatic-first" mental model alongside our current "manual-first" one.

Notes

  • Pairs with #62 (shares the composite-create machinery, #63) and #64 (templates for defaults).
  • Two mental models offered side by side: "build one by hand" (#62 builder) vs "generate many from my library" (this).

Related: #59, #62.


Delivery plan (2026-07-16)

Shipping a 3-axis MVP first (TV Show / TV Genre / Movie Genre) with the full pipeline (enumerate → preview → select → bulk-create), then adding the remaining axes incrementally. Design: docs/superpowers/specs/2026-07-16-auto-tuning-design.md.

  • PR1 — backend (#379, MERGED): enumeration + preview + bulk-create endpoints, SmartCollection generation, tests, OpenAPI + docs. Additive/non-destructive; server-owned queries.
  • PR2 — SPA wizard + live-E2E (#389): the auto-tune screen + real-library verification. #69 closes with PR2.
  • DetailPanel deferred → #383 (children #384/#385/#386): the per-channel editor from the design iteration needs new endpoints; backlogged per design-first.
  • Follow-ups (separate issues, after MVP): TV Network, Movie Studio, Mixed Genre, Music Genre, Smart-Collection→channel, Mixed Content; per-axis templates; even-show-distribution.

Done-when

  • PR1 backend merged (endpoints + tests + OpenAPI/docs) — #379
  • PR2 SPA auto-tune wizard implemented — #389
  • Live-E2E: seed a real TV+movie library, run preview → create, verify generated channels + valid M3U/XMLTV — passed (8 proposals; 3 channels created; smart-collection Lucene queries correct; playouts built; M3U #EXTINF+group-title + XMLTV <channel> verified)
  • Adversarial/independent review passed (both PRs) — PR1 cold whole-branch; PR2 cold review + fix re-review both MERGEABLE @ 8e82673e
  • Docs updated (decisions, api-conventions, domain-model, blazor-route-parity for the new screen) — PR1: decisions + api-conventions; PR2: domain-model + blazor-route-parity (net-new SPA screen)
Concept borrowed from **PseudoTV** (its signature feature). Relates to the redesign #59 and complements the manual create-channel builder (epic #62) as a **second creation mode**. ## Goal "Install it and it builds a lineup for you." A wizard that auto-generates whole channels from existing library metadata, so a large library becomes a full channel lineup with little manual work. ## Scope - Generate a channel per metadata axis: **TV Network, TV Show (per-show 24/7), TV Genre, Movie Genre, Movie Studio, Mixed Genre, Music Genre, Smart Collection, Mixed Content**. - Preview the generated channels before committing; let the user select which to keep and bulk-create. - Reuse existing primitives: ErsatzTV already has Collections, **Smart Collections**, and genre/studio/network filtering — this is largely orchestration over them (create Collection + Schedule + Playout per generated channel). - Sensible defaults via the Channel Template system (#64). ## Why The single biggest concept PseudoTV has that ErsatzTV lacks. Establishes the "automatic-first" mental model alongside our current "manual-first" one. ## Notes - Pairs with #62 (shares the composite-create machinery, #63) and #64 (templates for defaults). - Two mental models offered side by side: "build one by hand" (#62 builder) vs "generate many from my library" (this). Related: #59, #62. --- ## Delivery plan (2026-07-16) Shipping a **3-axis MVP first** (TV Show / TV Genre / Movie Genre) with the full pipeline (enumerate → preview → select → bulk-create), then adding the remaining axes incrementally. Design: `docs/superpowers/specs/2026-07-16-auto-tuning-design.md`. - **PR1 — backend** (#379, MERGED): enumeration + preview + bulk-create endpoints, SmartCollection generation, tests, OpenAPI + docs. Additive/non-destructive; server-owned queries. - **PR2 — SPA wizard + live-E2E** (#389): the auto-tune screen + real-library verification. **#69 closes with PR2.** - **DetailPanel deferred → #383** (children #384/#385/#386): the per-channel editor from the design iteration needs new endpoints; backlogged per design-first. - Follow-ups (separate issues, after MVP): TV Network, Movie Studio, Mixed Genre, Music Genre, Smart-Collection→channel, Mixed Content; per-axis templates; even-show-distribution. ## Done-when - [x] PR1 backend merged (endpoints + tests + OpenAPI/docs) — #379 - [x] PR2 SPA auto-tune wizard implemented — #389 - [x] Live-E2E: seed a real TV+movie library, run preview → create, verify generated channels + valid M3U/XMLTV — passed (8 proposals; 3 channels created; smart-collection Lucene queries correct; playouts built; M3U `#EXTINF`+`group-title` + XMLTV `<channel>` verified) - [x] Adversarial/independent review passed (both PRs) — PR1 cold whole-branch; PR2 cold review + fix re-review both MERGEABLE @ 8e82673e - [x] Docs updated (decisions, api-conventions, domain-model, blazor-route-parity for the new screen) — PR1: decisions + api-conventions; PR2: domain-model + blazor-route-parity (net-new SPA screen)
timothy added the enhancementcontentpriority: high labels 2026-07-01 23:44:02 +02:00
timothy added priority: medium and removed priority: high labels 2026-07-11 19:04:42 +02:00
timothy added the in-progress label 2026-07-16 20:54:55 +02:00
Author
Owner

claiming — session started 2026-07-16 20:54 CEST (Claude Code / Opus 4.8 orchestrator).

Context: the ChicoryTV rewrite + go-live arc (#237) is complete, so this is a post-arc backlog pickup. #69 is the lowest-numbered eligible priority: medium item; its key dependency #63 (composite create-channel-from-lineup endpoint) is already shipped. This is a large greenfield feature, so I'm starting with a design/brainstorming pass (scope, axes, preview/bulk-create UX, reuse of Collections/Smart Collections + #63 composite create) before any implementation — likely multi-session. Will post the design direction here for sign-off before building.

claiming — session started 2026-07-16 20:54 CEST (Claude Code / Opus 4.8 orchestrator). Context: the ChicoryTV rewrite + go-live arc (#237) is complete, so this is a post-arc backlog pickup. #69 is the lowest-numbered eligible `priority: medium` item; its key dependency #63 (composite create-channel-from-lineup endpoint) is already shipped. This is a large greenfield feature, so I'm starting with a design/brainstorming pass (scope, axes, preview/bulk-create UX, reuse of Collections/Smart Collections + #63 composite create) before any implementation — likely multi-session. Will post the design direction here for sign-off before building.
Author
Owner

PR1 (backend) opened → #379. CI running.

Grounded the design in the PseudoTV Live inspiration (its nine library axes, per-type ordering, "reserve a channel-number block") and deliberately fixed its two weaknesses: no preview/selection, and destructive wipe-and-rebuild. Our version is additive with a preview→select→bulk-create flow.

What PR1 ships — three /api/v1 endpoints for the 3-axis MVP (TV Show / TV Genre / Movie Genre):

  • POST /channels/auto-tune/preview — EF distinct+count enumeration → proposed channels (no writes)
  • POST /channels/auto-tune — per proposal: create a SmartCollection (server-generated Lucene query) → call #63 CreateChannelFromLineup → per-channel Created/Skipped/Failed

Design decisions (in docs/decisions.md): enumerate via EF / persist via SmartCollection (live queries), additive reserve-block numbering + name dedup, server-owned query generation. 16 new NUnit tests; cold-context whole-branch review → MERGEABLE after two Important fixes (null-body 500 guard; SmartCollection rollback on failed/skipped channel).

Next: PR2 = SPA wizard + live-E2E, which closes #69. Remaining six axes become follow-up issues after the MVP.

**PR1 (backend) opened → #379.** CI running. Grounded the design in the PseudoTV Live inspiration (its nine library axes, per-type ordering, "reserve a channel-number block") and deliberately fixed its two weaknesses: no preview/selection, and destructive wipe-and-rebuild. Our version is additive with a preview→select→bulk-create flow. **What PR1 ships** — three `/api/v1` endpoints for the 3-axis MVP (TV Show / TV Genre / Movie Genre): - `POST /channels/auto-tune/preview` — EF distinct+count enumeration → proposed channels (no writes) - `POST /channels/auto-tune` — per proposal: create a SmartCollection (server-generated Lucene query) → call #63 `CreateChannelFromLineup` → per-channel Created/Skipped/Failed **Design decisions** (in `docs/decisions.md`): enumerate via EF / persist via SmartCollection (live queries), additive reserve-block numbering + name dedup, server-owned query generation. 16 new NUnit tests; cold-context whole-branch review → MERGEABLE after two Important fixes (null-body 500 guard; SmartCollection rollback on failed/skipped channel). **Next**: PR2 = SPA wizard + live-E2E, which closes #69. Remaining six axes become follow-up issues after the MVP.
Author
Owner

PR1 (backend) MERGED to main → #379 (CI green: Build & test, Formatting, API-docs-in-sync, decisions.md append-only, migrations, E2E all passed). Remote branch deleted.

Backend for the 3-axis MVP is live on main: POST /api/v1/channels/auto-tune/preview + POST /api/v1/channels/auto-tune, orchestrating EF metadata enumeration → SmartCollection generation → #63 composite create, additive/non-destructive. 16 NUnit tests; cold whole-branch review + fix-commit re-review clean.

Remaining for #69: PR2 = the SPA auto-tune wizard + live-E2E (seed a real library, preview → create, verify M3U/XMLTV). #69 closes with PR2. The other six axes become follow-up issues after the MVP.

Leaving open for PR2.

**PR1 (backend) MERGED to main → #379** (CI green: Build & test, Formatting, API-docs-in-sync, decisions.md append-only, migrations, E2E all passed). Remote branch deleted. Backend for the 3-axis MVP is live on `main`: `POST /api/v1/channels/auto-tune/preview` + `POST /api/v1/channels/auto-tune`, orchestrating EF metadata enumeration → SmartCollection generation → #63 composite create, additive/non-destructive. 16 NUnit tests; cold whole-branch review + fix-commit re-review clean. **Remaining for #69**: PR2 = the SPA auto-tune wizard + live-E2E (seed a real library, preview → create, verify M3U/XMLTV). #69 closes with PR2. The other six axes become follow-up issues after the MVP. Leaving open for PR2.
timothy removed the in-progress label 2026-07-16 22:38:12 +02:00
timothy added the frontendin-progress labels 2026-07-16 22:58:59 +02:00
Author
Owner

Claiming for PR2 (SPA wizard) — session started 2026-07-16 (Claude Code / Opus 4.8).

Taking the design-first route via the /design-sync workflow before implementing in web/.

Design prototype pushed to Claude Design (ChicoryTV Design System project) + mirrored in design-system/ on the branch:

  • templates/chicorytv-admin/AutoTune.jsx — the interactive 3-step wizard prototype
  • design_handoff_auto_tune/README.md — the implementation spec (layout, pane-by-pane, API mapping table) subagents/impl build from
  • wired into app.html + a new Auto-Tune sidebar entry (icon Sparkles, right after New Channel)

The screen is a 3-step wizard driving the two PR1 endpoints, additive/non-destructive:

  1. Configure — selectable axis cards (TV Shows / TV Genres / Movie Genres) + defaults (min items, starting number, channel group, channel template).
  2. Preview (POST …/auto-tune/preview) — proposals grouped by axis, per-row + per-group checkboxes, allocated number, item count; already-existing names greyed + deselected (dedup).
  3. Create (POST …/auto-tune) — Created/Skipped/Failed Stat tiles + per-channel result list.

Verified rendering across all three steps in the warm + cool accent themes (fully token-driven, theme-aware). Paused for visual review in Claude Design before I build web/src/screens/AutoTuneScreen.tsx.

**Claiming for PR2 (SPA wizard)** — session started 2026-07-16 (Claude Code / Opus 4.8). Taking the design-first route via the `/design-sync` workflow before implementing in `web/`. **Design prototype pushed to Claude Design** (`ChicoryTV Design System` project) + mirrored in `design-system/` on the branch: - `templates/chicorytv-admin/AutoTune.jsx` — the interactive 3-step wizard prototype - `design_handoff_auto_tune/README.md` — the implementation spec (layout, pane-by-pane, API mapping table) subagents/impl build from - wired into `app.html` + a new **Auto-Tune** sidebar entry (icon `Sparkles`, right after New Channel) **The screen** is a 3-step wizard driving the two PR1 endpoints, additive/non-destructive: 1. **Configure** — selectable axis cards (TV Shows / TV Genres / Movie Genres) + defaults (min items, starting number, channel group, channel template). 2. **Preview** (`POST …/auto-tune/preview`) — proposals grouped by axis, per-row + per-group checkboxes, allocated number, item count; already-existing names greyed + deselected (dedup). 3. **Create** (`POST …/auto-tune`) — Created/Skipped/Failed Stat tiles + per-channel result list. Verified rendering across all three steps in the warm + cool accent themes (fully token-driven, theme-aware). **Paused for visual review in Claude Design before I build `web/src/screens/AutoTuneScreen.tsx`.**
Author
Owner

Design iterated + PR2 scope locked.

The prototype was iterated in Claude Design (working-copy project 4eb64b16) to add a per-channel DetailPanel — a "Configure" button on each Preview row opening a full per-channel editor (identity/image, shuffle/always-playing, template + Advanced overrides, weighted content sources, exclude/add-untagged, example schedule). Synced back into design-system/ (commit on feat/69-auto-tune-spa).

That DetailPanel needs backend the PR1 endpoints don't have, so per design-first it's deferred — filed as arc #383 (children #384 enumerate smart-collection members, #385 per-channel overrides + rotation weights in create, #386 the SPA panel), all priority: low, to start after this closes.

PR2 (implementing now) = the 3-step wizard only — Configure → Preview → Create — on the existing PR1 endpoints (no per-row Configure). New screen web/src/screens/AutoTuneScreen.tsx + api/autoTune.ts, route /app/auto-tune, tests, docs. Live-E2E + independent review before the PR. #69 still closes with this PR2.

**Design iterated + PR2 scope locked.** The prototype was iterated in Claude Design (working-copy project `4eb64b16`) to add a per-channel **DetailPanel** — a "Configure" button on each Preview row opening a full per-channel editor (identity/image, shuffle/always-playing, template + Advanced overrides, weighted content sources, exclude/add-untagged, example schedule). Synced back into `design-system/` (commit on `feat/69-auto-tune-spa`). That DetailPanel needs backend the PR1 endpoints don't have, so per **design-first** it's **deferred** — filed as arc **#383** (children **#384** enumerate smart-collection members, **#385** per-channel overrides + rotation weights in create, **#386** the SPA panel), all `priority: low`, to start after this closes. **PR2 (implementing now)** = the **3-step wizard only** — Configure → Preview → Create — on the existing PR1 endpoints (no per-row Configure). New screen `web/src/screens/AutoTuneScreen.tsx` + `api/autoTune.ts`, route `/app/auto-tune`, tests, docs. Live-E2E + independent review before the PR. **#69 still closes with this PR2.**
Author
Owner

Closed — Auto-Tune MVP shipped (PR2 #389 merged to main)

What shipped (PR2): the /app/auto-tune SPA wizard — the automatic-first channel-creation mode. Three steps on the PR1 endpoints, additive/non-destructive:

  • Configure — axis cards (TV Shows / TV Genres / Movie Genres) + defaults (min items, starting number, channel group, template).
  • Preview — proposals grouped by axis, per-row/per-group selection, allocated numbers, item counts; already-existing names deduped (greyed + deselected).
  • Create — Created/Skipped/Failed summary.

Files: web/src/api/autoTune.ts, web/src/screens/AutoTuneScreen.tsx (+ tests), route/nav wiring, App nav-smoke. Docs: domain-model.md (route) + blazor-route-parity.md (net-new SPA screen).

Design: iterated in Claude Design, synced to design-system/ + pushed to the canonical project. Visuals follow the approved prototype.

Verification:

  • Independent review — base cold review + fix re-review both MERGEABLE @ 8e82673e (fixed: selection keyed by axis+value to avoid same-name coupling + a regression test; zero-templates UX).
  • Live-E2E — seeded a real TV+movie library → 8 correct proposals → 3 channels created with correct smart-collection Lucene queries + built playouts → valid M3U (#EXTINF/group-title) and XMLTV (<channel>).
  • CI green on head (Build & test, Formatting, API-docs, decisions, EF migrations, Functional E2E).

Deferred (design-first): the per-channel DetailPanel from the design iteration needs new endpoints → #383 (children #384/#385/#386). Remaining six axes remain post-MVP follow-ups.

Both PRs merged; all Done-when satisfied. Closing.

## Closed — Auto-Tune MVP shipped (PR2 #389 merged to main) **What shipped (PR2):** the `/app/auto-tune` SPA wizard — the automatic-first channel-creation mode. Three steps on the PR1 endpoints, additive/non-destructive: - **Configure** — axis cards (TV Shows / TV Genres / Movie Genres) + defaults (min items, starting number, channel group, template). - **Preview** — proposals grouped by axis, per-row/per-group selection, allocated numbers, item counts; already-existing names deduped (greyed + deselected). - **Create** — Created/Skipped/Failed summary. **Files:** `web/src/api/autoTune.ts`, `web/src/screens/AutoTuneScreen.tsx` (+ tests), route/nav wiring, App nav-smoke. Docs: `domain-model.md` (route) + `blazor-route-parity.md` (net-new SPA screen). **Design:** iterated in Claude Design, synced to `design-system/` + pushed to the canonical project. Visuals follow the approved prototype. **Verification:** - Independent review — base cold review + fix re-review both **MERGEABLE @ 8e82673e** (fixed: selection keyed by `axis+value` to avoid same-name coupling + a regression test; zero-templates UX). - **Live-E2E** — seeded a real TV+movie library → 8 correct proposals → 3 channels created with correct smart-collection Lucene queries + built playouts → valid **M3U** (`#EXTINF`/`group-title`) and **XMLTV** (`<channel>`). - CI green on head (Build & test, Formatting, API-docs, decisions, EF migrations, Functional E2E). **Deferred (design-first):** the per-channel **DetailPanel** from the design iteration needs new endpoints → **#383** (children #384/#385/#386). Remaining six axes remain post-MVP follow-ups. Both PRs merged; all Done-when satisfied. Closing.
timothy removed the in-progress label 2026-07-17 00:31:22 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: timothy/ersatztv#69