fix(api): make channel state NowPlaying nullable in DTO

An off-air channel has no current playout item, so the handler returns
null for NowPlaying; the DTO now declares that (file-scoped #nullable —
ErsatzTV.Core has NRT disabled project-wide). Regenerated OpenAPI and
web types: nowPlaying keeps its nullable oneOf schema (matching the
schema contract test) and channelNumber loses a spurious nullable
annotation left over from an earlier draft — the field is required.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 21:37:00 +02:00
co-authored by Claude Fable 5
parent 07e9d9838d
commit e66f49e54a
3 changed files with 15 additions and 5 deletions
@@ -1,7 +1,9 @@
namespace ErsatzTV.Core.Api.Channels;
#nullable enable
public record ChannelStateResponseModel(
int ChannelId,
string ChannelNumber,
bool OnAir,
ChannelNowPlayingResponseModel NowPlaying);
ChannelNowPlayingResponseModel? NowPlaying);
+1 -4
View File
@@ -3559,10 +3559,7 @@
"format": "int32"
},
"channelNumber": {
"type": [
"null",
"string"
]
"type": "string"
},
"onAir": {
"type": "boolean"
+11
View File
@@ -38,6 +38,11 @@ export interface components {
};
"ChannelIdleBehavior": "StopOnDisconnect" | "KeepRunning";
"ChannelMusicVideoCreditsMode": "None" | "GenerateSubtitles";
"ChannelNowPlayingResponseModel": {
"title": null | string;
"startUtc": string;
"finishUtc": string;
};
"ChannelPlayoutMode": "Continuous" | "OnDemand";
"ChannelPlayoutSource": "Generated" | "Mirror";
"ChannelResponseModel": {
@@ -54,6 +59,12 @@ export interface components {
"showInEpg": boolean;
};
"ChannelSongVideoMode": "Default" | "WithProgress";
"ChannelStateResponseModel": {
"channelId": number;
"channelNumber": string;
"onAir": boolean;
"nowPlaying": null | components["schemas"]["ChannelNowPlayingResponseModel"];
};
"ChannelStreamSelectorMode": "Default" | "Custom" | "Troubleshooting";
"ChannelSubtitleMode": "None" | "Forced" | "Default" | "Any";
"ChannelTranscodeMode": "OnDemand";