soulsync/tests/media_server
Broque Thomas 49f7679eef MS Cin-1 + Cin-2: Explicit contract inheritance + generic accessors
Apply the Cin-1 / Cin-2 pattern from the download refactor PR to the
media server engine PR before review.

Cin-1 — explicit inheritance:
- PlexClient, JellyfinClient, NavidromeClient, SoulSyncClient now
  explicitly inherit MediaServerClient instead of relying on
  structural typing alone. Pre-change a reader of plex_client.py
  had no way to know the class was supposed to satisfy the contract.
- Removed the engine + registry re-exports from
  core/media_server/__init__.py to break the circular import that
  the inheritance change introduced (importing the package now
  triggered a chain that loaded clients before their base class
  resolved). Submodules import directly: from
  core.media_server.engine import MediaServerEngine, etc.
- Conformance test now also asserts isinstance() / issubclass()
  against MediaServerClient — drift in any class fails at the test
  boundary instead of at runtime.

Cin-2 — generic accessors + singleton:
- engine.configured_clients() — replaces the legacy per-server
  `if X and X.is_connected(): clients[name] = X` chains in
  web_server.py.
- engine.reload_config(name=None) — generic dispatch, so callers
  pass the server name instead of reaching for plex_client.reload_config()
  directly.
- get_media_server_engine() / set_media_server_engine() singleton
  factory matching the get_metadata_engine() / get_download_orchestrator()
  shape. web_server.py boots via set_media_server_engine(...) so
  factory + global handle share state.
- 7 new tests pin the accessors + singleton behaviour.
2026-05-05 16:59:05 -07:00
..
__init__.py Phase 0: Add MediaServerClient contract + registry 2026-05-04 20:49:25 -07:00
test_conformance.py MS Cin-1 + Cin-2: Explicit contract inheritance + generic accessors 2026-05-05 16:59:05 -07:00
test_engine.py MS Cin-1 + Cin-2: Explicit contract inheritance + generic accessors 2026-05-05 16:59:05 -07:00
test_jellyfin_pinning.py A2: Pin JellyfinClient observable behavior 2026-05-04 20:53:55 -07:00
test_navidrome_pinning.py A3: Pin NavidromeClient observable behavior 2026-05-04 21:01:11 -07:00
test_plex_pinning.py A1: Pin PlexClient observable behavior 2026-05-04 20:53:00 -07:00
test_soulsync_pinning.py A4: Pin SoulSyncClient observable behavior 2026-05-04 21:03:37 -07:00