36 lines
913 B
C#
36 lines
913 B
C#
using ErsatzTV.Core.Domain;
|
|
using MediatR;
|
|
|
|
namespace ErsatzTV.Application.Channels;
|
|
|
|
public record CreateAutoTunedChannels(
|
|
int TemplateId,
|
|
string Group,
|
|
List<AutoTuneChannelSelection> Channels) : IRequest<AutoTuneResult>;
|
|
|
|
public record AutoTuneChannelSelection(
|
|
AutoTuneAxis Axis,
|
|
string Value,
|
|
string Name,
|
|
string Number);
|
|
|
|
public record AutoTuneResult(List<AutoTuneChannelOutcome> Results)
|
|
{
|
|
public int CreatedCount => Results.Count(r => r.Status == AutoTuneOutcomeStatus.Created);
|
|
public int SkippedCount => Results.Count(r => r.Status == AutoTuneOutcomeStatus.Skipped);
|
|
public int FailedCount => Results.Count(r => r.Status == AutoTuneOutcomeStatus.Failed);
|
|
}
|
|
|
|
public record AutoTuneChannelOutcome(
|
|
string Name,
|
|
AutoTuneOutcomeStatus Status,
|
|
int? ChannelId,
|
|
string Reason);
|
|
|
|
public enum AutoTuneOutcomeStatus
|
|
{
|
|
Created,
|
|
Skipped,
|
|
Failed
|
|
}
|