docs(60): correct stale channel-preview design/decisions statements

The design spec claimed ChannelDetailResponseModel also gained the Preview
field; only ChannelResponseModel did (deliberate — nothing consumes it on the
detail DTO). Also record the two new Unavailable causes (disabled channel,
zero playouts) added to Mapper.GetPreview in the api.channel-preview-capability
decisions.md record.
This commit is contained in:
2026-07-21 23:13:27 +02:00
parent 6154aaebb2
commit 54610fe0af
2 changed files with 10 additions and 2 deletions
+7 -1
View File
@@ -3446,13 +3446,19 @@ leaving the shared tree dirty is the one outcome that would make this script a n
`key: api.channel-preview-capability` · `status: active` · `since: 2026-07-21` · `supersedes: none` · `superseded-by: none`
**Rule:** Whether a channel can be previewed in the browser is declared by the server, not derived by the SPA, as an additive `Preview` field (`{Availability, ManifestUrl, UnavailableReason}`) on `ChannelResponseModel`.
**Signals:** a Play button that does nothing; preview eligibility inferred from a display string; a green preview on a Transport Stream channel being read as validating its configured pipeline · paths: `ErsatzTV.Core/Api/Channels/ChannelPreviewResponseModel.cs`, `ErsatzTV.Application/Channels/Mapper.cs`, `web/src/screens/channels/ChannelPreviewPanel.tsx` · issues: #60
**Mechanics:** `Mapper.GetPreview(StreamingMode, channelNumber, iptvJwtEnabled)` is pure; `JwtHelper.IsEnabled` is read only at `ChannelController.GetAll` and passed in
**Mechanics:** `Mapper.GetPreview(StreamingMode, channelNumber, iptvJwtEnabled, isEnabled, playoutCount)` is pure; `JwtHelper.IsEnabled` is read only at `ChannelController.GetAll` and passed in
`ChannelPreviewAvailability` is one of `Available`, `ForcedHlsOnly`, or `Unavailable`, computed in one
place from the real `StreamingMode` enum plus JWT status. The SPA renders and acts on it and derives
nothing — deriving it client-side would mean keying behavior off `Mapper.GetStreamingMode`'s
human-readable display label, where a copy tweak would silently break playback.
`Unavailable` now covers three causes, checked in this order (first match wins): JWT enabled, the
channel is disabled (`IptvController` 404s a disabled channel, so preview must not even try), and
the channel has zero playouts (a manifest request against one blocks indefinitely). Only the JWT
case was in scope at first pass; the other two were keying preview on `StreamingMode` + JWT alone,
so a disabled or playout-less channel was declared `Available` and then failed confusingly.
Only the two HLS modes are browser-playable; a browser cannot play the `video/mp2t` that the
Transport Stream modes serve over `/iptv/*`. Those are declared `ForcedHlsOnly`: preview is offered
only as an explicit opt-in that requests `/iptv/channel/{n}.m3u8?mode=segmenter`, and is always shown
@@ -75,7 +75,9 @@ Following `api.healthcheck-remediation-dto` (server-declared metadata on an addi
the SPA renders and acts on it, it does not derive labels itself) and `api.artwork-rooted-urls`
(rooted, directly-usable URLs):
`ChannelResponseModel` and `ChannelDetailResponseModel` each gain:
`ChannelResponseModel` (the list DTO the SPA previews from) gains: `ChannelDetailResponseModel`
does not — nothing consumes it there, so it stays out deliberately rather than being added
speculatively.
```
Preview: {