diff --git a/CHANGELOG.md b/CHANGELOG.md index 4585cb651..7e4b04e7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Fixed +- Fix content repeating for up to a minute near the top of every hour ## [0.6.1-beta] - 2022-06-03 ### Fixed diff --git a/ErsatzTV.Application/Playouts/Commands/BuildPlayoutHandler.cs b/ErsatzTV.Application/Playouts/Commands/BuildPlayoutHandler.cs index 57fdea6b1..fbf7b09a2 100644 --- a/ErsatzTV.Application/Playouts/Commands/BuildPlayoutHandler.cs +++ b/ErsatzTV.Application/Playouts/Commands/BuildPlayoutHandler.cs @@ -5,6 +5,7 @@ using ErsatzTV.Core; using ErsatzTV.Core.Domain; using ErsatzTV.Core.Interfaces.FFmpeg; using ErsatzTV.Core.Interfaces.Scheduling; +using ErsatzTV.Core.Scheduling; using ErsatzTV.Infrastructure.Data; using ErsatzTV.Infrastructure.Extensions; using Microsoft.EntityFrameworkCore; @@ -37,7 +38,7 @@ public class BuildPlayoutHandler : IRequestHandler validation = await Validate(dbContext, request); - return await LanguageExtensions.Apply(validation, playout => ApplyUpdateRequest(dbContext, request, playout)); + return await validation.Apply(playout => ApplyUpdateRequest(dbContext, request, playout)); } private async Task ApplyUpdateRequest(TvContext dbContext, BuildPlayout request, Playout playout) @@ -45,7 +46,11 @@ public class BuildPlayoutHandler : IRequestHandler 0) + + // let any active segmenter processes know that the playout has been modified + // and therefore the segmenter may need to seek into the next item instead of + // starting at the beginning (if already working ahead) + if (request.Mode != PlayoutBuildMode.Continue && await dbContext.SaveChangesAsync() > 0) { _ffmpegSegmenterService.PlayoutUpdated(playout.Channel.Number); } diff --git a/ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj b/ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj index e339c6aba..70013f27d 100644 --- a/ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj +++ b/ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/ErsatzTV.Core/ErsatzTV.Core.csproj b/ErsatzTV.Core/ErsatzTV.Core.csproj index e8107ddb5..ffb92ad98 100644 --- a/ErsatzTV.Core/ErsatzTV.Core.csproj +++ b/ErsatzTV.Core/ErsatzTV.Core.csproj @@ -10,7 +10,8 @@ - + + diff --git a/ErsatzTV.Core/Scheduling/PlayoutBuildMode.cs b/ErsatzTV.Core/Scheduling/PlayoutBuildMode.cs index 78a46746d..d67fefe83 100644 --- a/ErsatzTV.Core/Scheduling/PlayoutBuildMode.cs +++ b/ErsatzTV.Core/Scheduling/PlayoutBuildMode.cs @@ -2,12 +2,18 @@ public enum PlayoutBuildMode { - // this continues building playout into the future + /// + /// Continue building the playout into the future, without changing any existing playout items + /// Continue = 1, - // this rebuilds a playout but will maintain collection progress + /// + /// Rebuild the playout while attempting to maintain collection progress + /// Refresh = 2, - // this rebuilds a playout and clears all state + /// + /// Rebuild the playout from scratch (clearing all state) + /// Reset = 3 } diff --git a/ErsatzTV.FFmpeg/ErsatzTV.FFmpeg.csproj b/ErsatzTV.FFmpeg/ErsatzTV.FFmpeg.csproj index 8cc2bef8d..6dada5313 100644 --- a/ErsatzTV.FFmpeg/ErsatzTV.FFmpeg.csproj +++ b/ErsatzTV.FFmpeg/ErsatzTV.FFmpeg.csproj @@ -8,7 +8,7 @@ - + diff --git a/ErsatzTV/ErsatzTV.csproj b/ErsatzTV/ErsatzTV.csproj index 1c3d52cee..bc10889d4 100644 --- a/ErsatzTV/ErsatzTV.csproj +++ b/ErsatzTV/ErsatzTV.csproj @@ -57,8 +57,8 @@ - - + +