using ErsatzTV.Application.Artworks; using ErsatzTV.Application.Channels; using ErsatzTV.Core.Domain; namespace ErsatzTV.Controllers.Api.Requests; public record PreviewAutoTuneChannelsRequest( List Axes, int MinItems, int StartingNumber) { public PreviewAutoTuneChannels ToCommand() => new(Axes, MinItems, StartingNumber); } public record CreateAutoTunedChannelsRequest( int TemplateId, string Group, List Channels) { public CreateAutoTunedChannels ToCommand() => new(TemplateId, Group, (Channels ?? []).Select(c => c.ToCommand()).ToList()); } // Optional per-channel overrides (DetailPanel, #385): TemplateId overrides the batch template; Advanced // carries the same override set as the manual Channel Builder (reuses CreateChannelFromLineupAdvancedOptionsRequest); // Logo is an uploaded channel image ({path, contentType}). All optional — an omitted field keeps the PR1 // behavior (batch template, axis-derived playback order, no logo). Note: no #nullable pragma here (matches the // rest of this file), so the new reference-type params carry no `?` annotation; they default to null. public record AutoTunedChannelRequest( AutoTuneAxis Axis, string Value, string Name, string Number, int? TemplateId = null, ArtworkContentTypeModel Logo = null, CreateChannelFromLineupAdvancedOptionsRequest Advanced = null, List Sources = null) { public AutoTuneChannelSelection ToCommand() => new( Axis, Value, Name, Number, TemplateId, (Logo ?? ArtworkContentTypeModel.None).Sanitized(), Advanced?.ToCommand(), Sources?.Select(s => s.ToCommand()).ToList()); } // Per-source rotation weight + query correction (#425). SourceId is the show/movie id from the members // list (GET /api/v1/channels/auto-tune/members); Weight defaults to 1 (fair-share); Excluded drops it. public record AutoTuneSourceWeightRequest(int SourceId, int Weight = 1, bool Excluded = false) { public AutoTuneSourceWeight ToCommand() => new(SourceId, Weight, Excluded); }