using CliWrap; using ErsatzTV.Core.Interfaces.Streaming; namespace ErsatzTV.Application.Streaming; public class PlayoutItemProcessModel { public PlayoutItemProcessModel( Command process, Option graphicsEngineContext, Option maybeDuration, DateTimeOffset until, bool isComplete, Option segmentKey, Option mediaItemId, Option playoutOffset, bool isWorkingAhead) { Process = process; GraphicsEngineContext = graphicsEngineContext; MaybeDuration = maybeDuration; Until = until; IsComplete = isComplete; SegmentKey = segmentKey; MediaItemId = mediaItemId; IsWorkingAhead = isWorkingAhead; // undo the offset applied in FFmpegProcessHandler // so we don't continually walk backward/forward in time by the offset amount foreach (TimeSpan offset in playoutOffset) { foreach (long key in SegmentKey) { SegmentKey = key + (long)offset.TotalSeconds; } Until += offset; } } public Command Process { get; init; } public Option GraphicsEngineContext { get; init; } public Option MaybeDuration { get; init; } public DateTimeOffset Until { get; init; } public bool IsComplete { get; init; } public Option SegmentKey { get; init; } public Option MediaItemId { get; init; } public bool IsWorkingAhead { get; init; } }