diff --git a/ErsatzTV.Application/ProgramSchedules/Commands/ProgramScheduleItemCommandBase.cs b/ErsatzTV.Application/ProgramSchedules/Commands/ProgramScheduleItemCommandBase.cs index 400b8c43..b77171bc 100644 --- a/ErsatzTV.Application/ProgramSchedules/Commands/ProgramScheduleItemCommandBase.cs +++ b/ErsatzTV.Application/ProgramSchedules/Commands/ProgramScheduleItemCommandBase.cs @@ -132,11 +132,14 @@ namespace ErsatzTV.Application.ProgramSchedules.Commands CollectionType = item.CollectionType, CollectionId = item.CollectionId, MediaItemId = item.MediaItemId, - PlayoutDuration = item.PlayoutDuration.GetValueOrDefault(), + PlayoutDuration = FixDuration(item.PlayoutDuration.GetValueOrDefault()), OfflineTail = item.OfflineTail.GetValueOrDefault(), CustomTitle = item.CustomTitle }, _ => throw new NotSupportedException($"Unsupported playout mode {item.PlayoutMode}") }; + + private static TimeSpan FixDuration(TimeSpan duration) => + duration > TimeSpan.FromDays(1) ? duration.Subtract(TimeSpan.FromDays(1)) : duration; } } diff --git a/ErsatzTV/ErsatzTV.csproj b/ErsatzTV/ErsatzTV.csproj index e5e7de3e..f7b0e9fc 100644 --- a/ErsatzTV/ErsatzTV.csproj +++ b/ErsatzTV/ErsatzTV.csproj @@ -12,7 +12,6 @@ - all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -35,6 +34,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive +