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 from its and /// — no round-trip needed at call sites that already hold the medium /// (Archive cards, AlbumsView cards, the player-bar title). The thin /tracks/{entryKey} /// redirect page fetches by EntryKey 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/{entryKey}, /sessions/{entryKey}, /// or /mixes/{entryKey}. The route carries the release's opaque public EntryKey (Phase 11 /// §3e) — never the transparent int PK. 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(string entryKey, ReleaseMedium medium) => medium switch { ReleaseMedium.Session => $"/sessions/{entryKey}", ReleaseMedium.Mix => $"/mixes/{entryKey}", _ => $"/cuts/{entryKey}", }; /// Convenience overload for call sites holding a . public static string DetailHref(ReleaseDto release) => DetailHref(release.EntryKey, release.Medium); }