Files
ersatztv/ErsatzTV/ViewModels/PlayoutEditViewModel.cs
T
Jason DoveandGitHub 53f281ce32 add xmltv block behavior setting (#2336)
* replace playout externaljsonfile and templatefile with schedulefile

* add scripted schedule-based playout

* wip - not functional yet

* temp disable scripted playout creation

* allow fast-forwarding block playouts

* add xmltv block behavior setting
2025-08-23 20:16:12 +00:00

24 lines
894 B
C#

using ErsatzTV.Application.Channels;
using ErsatzTV.Application.Playouts;
using ErsatzTV.Application.ProgramSchedules;
namespace ErsatzTV.ViewModels;
public class PlayoutEditViewModel
{
public string Kind { get; set; }
public ChannelViewModel Channel { get; set; }
public ProgramScheduleViewModel ProgramSchedule { get; set; }
public string ScheduleFile { get; set; }
public CreatePlayout ToCreate() =>
Kind switch
{
PlayoutKind.ExternalJson => new CreateExternalJsonPlayout(Channel.Id, ScheduleFile),
PlayoutKind.Sequential => new CreateSequentialPlayout(Channel.Id, ScheduleFile),
PlayoutKind.Scripted => new CreateScriptedPlayout(Channel.Id, ScheduleFile),
PlayoutKind.Block => new CreateBlockPlayout(Channel.Id),
_ => new CreateClassicPlayout(Channel.Id, ProgramSchedule.Id)
};
}