using ErsatzTV.Application.Artworks; using ErsatzTV.Application.Channels; using ErsatzTV.Core.Domain; namespace ErsatzTV.Controllers.Api.Requests; /// /// JSON request body for creating a channel. Mirrors ; decoupling the /// API contract from the MediatR command keeps the wire format stable as the command evolves. /// public record CreateChannelRequest( string Name, string Number, string Group, string Categories, int FFmpegProfileId, double? SlugSeconds, ArtworkContentTypeModel Logo, ChannelStreamSelectorMode StreamSelectorMode, string StreamSelector, string PreferredAudioLanguageCode, string PreferredAudioTitle, ChannelPlayoutSource PlayoutSource, ChannelPlayoutMode PlayoutMode, int? MirrorSourceChannelId, TimeSpan? PlayoutOffset, StreamingMode StreamingMode, int? WatermarkId, int? FallbackFillerId, string PreferredSubtitleLanguageCode, ChannelSubtitleMode SubtitleMode, ChannelMusicVideoCreditsMode MusicVideoCreditsMode, string MusicVideoCreditsTemplate, ChannelSongVideoMode SongVideoMode, ChannelTranscodeMode TranscodeMode, ChannelIdleBehavior IdleBehavior, bool IsEnabled, bool ShowInEpg) { public CreateChannel ToCommand() => new( Name, Number, Group, Categories, FFmpegProfileId, SlugSeconds, (Logo ?? ArtworkContentTypeModel.None).Sanitized(), StreamSelectorMode, StreamSelector, PreferredAudioLanguageCode, PreferredAudioTitle, PlayoutSource, PlayoutMode, MirrorSourceChannelId, PlayoutOffset, StreamingMode, WatermarkId, FallbackFillerId, PreferredSubtitleLanguageCode, SubtitleMode, MusicVideoCreditsMode, MusicVideoCreditsTemplate, SongVideoMode, TranscodeMode, IdleBehavior, IsEnabled, ShowInEpg); }