- GET /api/playouts — paged list over GetPagedPlayouts (query/pageNum/pageSize), list DTO with buildStatus (#100, #107) - GET /api/playouts/{id}/items — paged future items + UNSCHEDULED gaps over GetFuturePlayoutItemsById; 404 ProblemDetails for unknown playout (matches /api/schedules/{id}/items precedent) (#101) - buildStatus {lastBuild, success, message} on GET /api/playouts/{id} (BuildStatus now included by GetPlayoutByIdHandler) (#107) - GET /api/playouts/warnings/count — failed-build count for the warnings badge (#107) - POST /api/playouts/reset-all — 202 Accepted, wraps ResetAllPlayouts (#110) - POST /api/channels/{channelNumber}/playout/reset — optional ?mode= override; default branches by ScheduleKind (Classic→Refresh, others→Reset) to match Blazor semantics (#110) - Option<FillerKind>→FillerKind? projection uses MatchUnsafe (Match throws on null-returning branch; idiom per Health/Mapper.cs) - Tests: controller unit tests (routes, projections, 404s, reset-mode defaults), OpenAPI ProblemDetails contract entry for /api/playouts/{id}/items get 404 - Regenerated wwwroot/openapi/v1.json Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
38 lines
987 B
C#
38 lines
987 B
C#
#nullable enable
|
|
using ErsatzTV.Core.Domain;
|
|
|
|
namespace ErsatzTV.Core.Api.Playouts;
|
|
|
|
public record PlayoutResponseModel(
|
|
int Id,
|
|
PlayoutScheduleKind ScheduleKind,
|
|
string ChannelName,
|
|
string ChannelNumber,
|
|
ChannelPlayoutMode PlayoutMode,
|
|
string ScheduleName,
|
|
string? ScheduleFile,
|
|
TimeSpan? DailyRebuildTime,
|
|
PlayoutBuildStatusResponseModel? BuildStatus)
|
|
{
|
|
public static PlayoutResponseModel From(
|
|
int id,
|
|
PlayoutScheduleKind scheduleKind,
|
|
string channelName,
|
|
string channelNumber,
|
|
ChannelPlayoutMode playoutMode,
|
|
string scheduleName,
|
|
string? scheduleFile,
|
|
TimeSpan? dailyRebuildTime,
|
|
PlayoutBuildStatusResponseModel? buildStatus) =>
|
|
new(
|
|
id,
|
|
scheduleKind,
|
|
channelName,
|
|
channelNumber,
|
|
playoutMode,
|
|
scheduleName,
|
|
scheduleFile,
|
|
dailyRebuildTime,
|
|
buildStatus);
|
|
}
|