Mint ChannelDetailResponseModel (faithful detail DTO exposing the raw editable field set the channel editor reads: raw FFmpegProfileId/WatermarkId/FallbackFillerId ids, the mode enums, logo, playoutCount, id) and route GetById/Create/Update through it, replacing the lean list ChannelResponseModel that resolved the profile to a name and dropped the editable ids (a functional regression for draftFromChannel). The lean ChannelResponseModel stays unchanged for GET /api/channels. webEncodedName dropped (SPA never reads it). Logo is mirrored as a Core ChannelLogoResponseModel since the Application ArtworkContentTypeModel can't be referenced from Core. Repoint the hand-written SPA client aliases now that the VMs are gone from the schema: Channel -> ChannelDetailResponseModel, MediaCollection/SmartCollection -> *ResponseModel, ProgramSchedule -> ProgramScheduleResponseModel. Fix #288 honest-nullability test fallout in search.test.ts (null -> [] for now-non-null id arrays). Include the already-on-disk playouts.ts WithDayNames removal and regenerate v1.json + v1.d.ts + endpoint-index.md (authoritative final regen; the reset endpoint's {channelNumber}->{id} re-key surfaces in the generated docs and the OpenApi error-contract test). Refs #288 #197 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
16 lines
630 B
C#
16 lines
630 B
C#
using ErsatzTV.Core.Api.Channels;
|
|
using ErsatzTV.Core.Interfaces.Repositories;
|
|
using static ErsatzTV.Application.Channels.Mapper;
|
|
|
|
namespace ErsatzTV.Application.Channels;
|
|
|
|
public class GetChannelByIdForApiHandler(IChannelRepository channelRepository)
|
|
: IRequestHandler<GetChannelByIdForApi, Option<ChannelDetailResponseModel>>
|
|
{
|
|
public Task<Option<ChannelDetailResponseModel>> Handle(
|
|
GetChannelByIdForApi request,
|
|
CancellationToken cancellationToken) =>
|
|
channelRepository.GetChannel(request.Id)
|
|
.MapT(channel => ProjectToDetailResponseModel(channel, channel.Playouts?.Count ?? 0));
|
|
}
|