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:
@@ -1,7 +1,9 @@
|
||||
namespace ErsatzTV.Core.Api.Channels;
|
||||
|
||||
#nullable enable
|
||||
|
||||
public record ChannelStateResponseModel(
|
||||
int ChannelId,
|
||||
string ChannelNumber,
|
||||
bool OnAir,
|
||||
ChannelNowPlayingResponseModel NowPlaying);
|
||||
ChannelNowPlayingResponseModel? NowPlaying);
|
||||
|
||||
@@ -3559,10 +3559,7 @@
|
||||
"format": "int32"
|
||||
},
|
||||
"channelNumber": {
|
||||
"type": [
|
||||
"null",
|
||||
"string"
|
||||
]
|
||||
"type": "string"
|
||||
},
|
||||
"onAir": {
|
||||
"type": "boolean"
|
||||
|
||||
Vendored
+11
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user