soulsync/core/media_server
Broque Thomas 6b54ca6598 Phase B: Add MediaServerEngine skeleton
`MediaServerEngine` reads the active server from config + dispatches
to the corresponding registered client. Per-server reaches still
work through `engine.client(name)`.

Required-method dispatch (is_connected, ensure_connection,
get_all_artists, get_all_album_ids) returns safe defaults when
the active client failed to initialize OR when the method raises.

Optional-method dispatch (search_tracks, trigger_library_scan,
is_library_scanning, get_library_stats, get_recently_added_albums)
checks hasattr first — SoulSync standalone has no
trigger_library_scan or get_library_stats, engine no-ops with
appropriate defaults instead of forcing every client to declare
stub methods.

10 new engine tests pin: active-server resolution, required
dispatch routing, exception safety, missing-optional-method
fallback shape. Suite still green (1951 passed).

Engine isn't on any production code path yet — Phase C migrates
the 33 web_server.py dispatch sites to call engine.method()
instead of hand-branching by active_server name.
2026-05-04 21:14:17 -07:00
..
__init__.py Phase B: Add MediaServerEngine skeleton 2026-05-04 21:14:17 -07:00
contract.py Phase 0: Add MediaServerClient contract + registry 2026-05-04 20:49:25 -07:00
engine.py Phase B: Add MediaServerEngine skeleton 2026-05-04 21:14:17 -07:00
registry.py Phase 0: Add MediaServerClient contract + registry 2026-05-04 20:49:25 -07:00