diff --git a/docs/architecture/README.md b/docs/architecture/README.md index f8279e4..5b88b87 100644 --- a/docs/architecture/README.md +++ b/docs/architecture/README.md @@ -13,6 +13,7 @@ JellyTau uses a client-server architecture: business logic lives in a comprehens - **Business Logic in Rust**: Core logic — playback, repository, sync, downloads, connectivity — lives in Rust for performance, reliability, and type safety. - **Presentation in Svelte**: The frontend (~20.5k non-test lines) owns UI, layout, navigation, and interaction state and invokes Rust commands. It is intentionally UI-heavy, **not** a thin wrapper. Largest pieces: components + routes (~14.6k lines), stores (~3.4k), api/services/utils (~2.4k); `VideoPlayer.svelte` alone is ~1.6k lines. - **Events + Polling hybrid**: Rust emits events the frontend listens to, and the UI also polls status on short intervals in a few hot spots (e.g. queue status in `library/+layout.svelte`, playback progress in `VideoPlayer.svelte`). +- **Unified player boundary**: UI components control playback only through the frontend facade `src/lib/player/index.ts` (`playerController`), never by calling `commands.player*` directly. Webview-rendered HTML5 video reports its state back into Rust via `src/lib/player/html5Adapter.ts` and the `player_report_*` commands, so the `PlayerController` stays the single source of truth in both native (MPV/ExoPlayer) and HTML5 modes (see [05-platform-backends.md](05-platform-backends.md)). - **Handle-Based Resources**: UUID handles for stateful Rust objects. - **Cache-First**: Parallel queries with intelligent fallback. - **Single source of truth for reachability**: Server reachability is derived from the outcome of *real repository traffic*, not a side-channel poller. The `OnlineRepository` reports each server result to the `ConnectivityMonitor` (classified via `RepoError`), which applies a time-window debounce before declaring the server offline and recovers instantly on the first success. The standalone `/System/Info/Public` probe runs *only while offline*, as a recovery detector for idle sessions. @@ -166,6 +167,9 @@ src/lib/ │ ├── repository-client.ts # RepositoryClient wrapper (~100 lines) │ ├── client.ts # JellyfinClient (helper for streaming) │ └── sessions.ts # SessionsApi (remote session control) +├── player/ # Unified player boundary (frontend) +│ ├── index.ts # playerController facade — the only write-side entry point for playback +│ └── html5Adapter.ts # Reports webview