using DeepDrftModels.DTOs; using DeepDrftModels.Enums; namespace DeepDrftPublic.Client.Common; /// /// The single source of truth for a release's dedicated detail route (Phase 11 §2). A release /// resolves to its per-medium detail page purely from its id and — no /// round-trip needed at call sites that already hold the medium (Archive cards, AlbumsView cards, /// the player-bar title). The thin /tracks/{id} redirect page fetches by id to discover the /// medium, then resolves through this same helper, so the medium→route table lives in exactly one /// place. /// public static class ReleaseRoutes { /// /// The dedicated detail route for a release: /cuts/{id}, /sessions/{id}, or /// /mixes/{id}. Cut is the default arm so a new medium without an entry here surfaces a /// build-visible gap rather than a silent fallthrough — extend the switch when a fourth medium lands. /// public static string DetailHref(long id, ReleaseMedium medium) => medium switch { ReleaseMedium.Session => $"/sessions/{id}", ReleaseMedium.Mix => $"/mixes/{id}", _ => $"/cuts/{id}", }; /// Convenience overload for call sites holding a . public static string DetailHref(ReleaseDto release) => DetailHref(release.Id, release.Medium); }