#nullable enable

using ErsatzTV.Application.ChannelTemplates;
using ErsatzTV.Core.Domain;
using ErsatzTV.Core.Scheduling;

namespace ErsatzTV.Controllers.Api.Requests;

public record CreateChannelTemplateRequest(
    string Name,
    string Description,
    int FFmpegProfileId,
    int? WatermarkId,
    int? FallbackFillerId,
    int? PreRollFillerId,
    int? MidRollFillerId,
    int? PostRollFillerId,
    ChannelStreamSelectorMode StreamSelectorMode,
    string? StreamSelector,
    string? PreferredAudioLanguageCode,
    string? PreferredAudioTitle,
    ChannelPlayoutSource PlayoutSource,
    ChannelPlayoutMode PlayoutMode,
    StreamingMode StreamingMode,
    string? PreferredSubtitleLanguageCode,
    ChannelSubtitleMode SubtitleMode,
    ChannelMusicVideoCreditsMode MusicVideoCreditsMode,
    string? MusicVideoCreditsTemplate,
    ChannelSongVideoMode SongVideoMode,
    ChannelTranscodeMode TranscodeMode,
    ChannelIdleBehavior IdleBehavior,
    bool ShuffleScheduleItems,
    bool RandomStartPoint,
    FixedStartTimeBehavior FixedStartTimeBehavior)
{
    public CreateChannelTemplate ToCommand() =>
        new(
            Name,
            Description,
            FFmpegProfileId,
            WatermarkId,
            FallbackFillerId,
            PreRollFillerId,
            MidRollFillerId,
            PostRollFillerId,
            StreamSelectorMode,
            StreamSelector,
            PreferredAudioLanguageCode,
            PreferredAudioTitle,
            PlayoutSource,
            PlayoutMode,
            StreamingMode,
            PreferredSubtitleLanguageCode,
            SubtitleMode,
            MusicVideoCreditsMode,
            MusicVideoCreditsTemplate,
            SongVideoMode,
            TranscodeMode,
            IdleBehavior,
            ShuffleScheduleItems,
            RandomStartPoint,
            FixedStartTimeBehavior);
}
