Skip to content

Retire the standalone browser UI and add a migration owner - #39

Merged
ChrisonSimtian merged 1 commit into
mainfrom
chore/remove-internal-api
Jul 26, 2026
Merged

Retire the standalone browser UI and add a migration owner#39
ChrisonSimtian merged 1 commit into
mainfrom
chore/remove-internal-api

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Contributor

What & why

The internal JSON API (Api/PublicApi) and the Blazor browse UI (Web) were the standalone-Mediathek-browser product that DR-010 superseded — Sonarr/Radarr drive Krautwatch now, so there's no first-party browse surface. This is part 4 (final) of the *arr API-surface plan.

I confirmed with a full read of Web first: it's 100% browse (Catalog/Shows/EpisodeDetail/Downloads/Search, "MediathekNext" branding, HTTP client to the internal Api) — nothing config-related to salvage. The real *arr config UI (Sonarr instances, apikey) is separate greenfield work.

Changes

  • Delete src/Presentation/Api/PublicApi and src/Presentation/Web entirely (~3k lines of dead browse code + its MediathekApiClient).
  • Add src/Presentation/Migrator — a run-to-completion worker that owns EF migrations and exits. Every DB consumer (newznab + agents) WaitForCompletion(migrator), which removes the old "the API host migrates at startup" coupling (and the start-order race it implied — agents/newznab previously only WaitFor(db) the container, not the schema).
  • AppHost drops api/web, adds migrator; slnx + AppHost refs updated.
  • CLAUDE.md refreshed: Presentation tree, retirement note, EF command no longer points at the deleted Api, Blazor removed, Mapperly added.

Notes

  • No first-party UI ships after this — intentional. A config UI is future work.
  • Migration ownership is now unambiguous and race-free via WaitForCompletion.
  • ./build.cmd Test green (Application 44 / Architecture 8 / Infrastructure 47) — no test touched the deleted projects.

Plan complete

  1. ✅ Model (Adopt Sonarr's series and episode numbering model #36) · 2. ✅ Newznab (Expose a Newznab indexer for Sonarr and Prowlarr #37) · 3. ✅ SABnzbd (Expose a SABnzbd-compatible download client #38) · 4. ✅ Cleanup (this)

Remaining real work: the Downloader agent — consume the enqueued jobs and do the actual raw/ffmpeg pull, the one piece that turns a Sonarr grab into a file on disk.

🤖 Generated with Claude Code

The internal JSON API (Api/PublicApi) and the Blazor browse UI (Web) were the
standalone-Mediathek-browser product that DR-010 superseded — Sonarr/Radarr drive
Krautwatch now, so there is no first-party browse surface. Part 4 (final) of the
*arr API-surface plan.

- Delete src/Presentation/Api/PublicApi and src/Presentation/Web entirely
  (~3k lines of dead browse code + its HttpClient).
- Add src/Presentation/Migrator — a run-to-completion worker that owns EF
  migrations and exits. Every DB consumer (newznab + agents) WaitForCompletion it,
  which removes the old "the API host migrates at startup" coupling and the
  startup race it implied.
- AppHost drops the api/web resources and adds the migrator; slnx + AppHost refs
  updated. CLAUDE.md architecture/commands refreshed (Blazor removed, EF command
  no longer points at the deleted Api, Mapperly noted).

A genuine *arr config UI (Sonarr/Radarr instances, apikey) is future greenfield
work — the retired Web had none of it. ./build.cmd Test green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ChrisonSimtian
ChrisonSimtian merged commit 308395b into main Jul 26, 2026
1 check passed
@ChrisonSimtian
ChrisonSimtian deleted the chore/remove-internal-api branch July 26, 2026 10:45
ChrisonSimtian added a commit that referenced this pull request Jul 26, 2026
A fresh, purpose-built first-party UI so Krautwatch is usable on its own, without
a Sonarr/Radarr instance (the old pre-DR-010 browser was deleted in #39; this is
not that).

- Presentation/Web: Blazor Server, talks to the Application layer in-process (no
  HTTP hop). Pages: Home, Search (find crawled episodes → one-click download via
  AddDownloadByTokenHandler), Activity (live download monitor, auto-refresh every
  3s off GetDownloadQueue). Each user action uses a fresh DI scope so Blazor
  Server's circuit-scoped DbContext can't be used concurrently.
- AppHost runs it (WithExternalHttpEndpoints, WaitForCompletion(migrator)); it does
  not own migrations. slnx + AppHost refs updated.

Also fixes a latent fleet-wide DI bug this surfaced: AddApplication registered
RunDownloadHandler (needs IDownloadProvider) and AddInfrastructure registered
IMessageDispatcher→WolverineDispatcher (needs Wolverine's IMessageBus) for ALL
hosts, so dev-time ValidateOnBuild failed in any host without those deps (Web,
newznab, migrator, crawl agents). Scoped both to their real consumers:
RunDownloadHandler → the Downloader host; IMessageDispatcher → new
AddMessageDispatcher() called by the crawl agents.

Smoke-tested: the app boots, Home/health/app.css serve 200. ./build.cmd Test green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ChrisonSimtian ChrisonSimtian added the skip-changelog Housekeeping with no consumer-facing note — kept out of the release notes. label Aug 2, 2026
@ChrisonSimtian ChrisonSimtian changed the title chore(cleanup): retire the pre-DR-010 browser; add a migration owner Retire the standalone browser UI and add a migration owner Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Housekeeping with no consumer-facing note — kept out of the release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant