Browse Source

fix repeating content (#838)

* fix repeating content

* update dependencies
pull/840/head
Jason Dove 3 years ago committed by GitHub
parent
commit
0a92996da8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 9
      ErsatzTV.Application/Playouts/Commands/BuildPlayoutHandler.cs
  3. 2
      ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj
  4. 3
      ErsatzTV.Core/ErsatzTV.Core.csproj
  5. 12
      ErsatzTV.Core/Scheduling/PlayoutBuildMode.cs
  6. 2
      ErsatzTV.FFmpeg/ErsatzTV.FFmpeg.csproj
  7. 4
      ErsatzTV/ErsatzTV.csproj

2
CHANGELOG.md

@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. @@ -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

9
ErsatzTV.Application/Playouts/Commands/BuildPlayoutHandler.cs

@ -5,6 +5,7 @@ using ErsatzTV.Core; @@ -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<BuildPlayout, Either<BaseErro @@ -37,7 +38,7 @@ public class BuildPlayoutHandler : IRequestHandler<BuildPlayout, Either<BaseErro
{
await using TvContext dbContext = await _dbContextFactory.CreateDbContextAsync(cancellationToken);
Validation<BaseError, Playout> 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<Unit> ApplyUpdateRequest(TvContext dbContext, BuildPlayout request, Playout playout)
@ -45,7 +46,11 @@ public class BuildPlayoutHandler : IRequestHandler<BuildPlayout, Either<BaseErro @@ -45,7 +46,11 @@ public class BuildPlayoutHandler : IRequestHandler<BuildPlayout, Either<BaseErro
try
{
await _playoutBuilder.Build(playout, request.Mode);
if (await dbContext.SaveChangesAsync() > 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);
}

2
ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj

@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
<PackageReference Include="Bugsnag" Version="3.0.1" />
<PackageReference Include="CliWrap" Version="3.4.4" />
<PackageReference Include="FluentAssertions" Version="6.7.0" />
<PackageReference Include="LanguageExt.Core" Version="4.1.1" />
<PackageReference Include="LanguageExt.Core" Version="4.2.2" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />

3
ErsatzTV.Core/ErsatzTV.Core.csproj

@ -10,7 +10,8 @@ @@ -10,7 +10,8 @@
<PackageReference Include="Bugsnag" Version="3.0.1" />
<PackageReference Include="Destructurama.Attributed" Version="3.0.0" />
<PackageReference Include="Flurl" Version="3.0.6" />
<PackageReference Include="LanguageExt.Core" Version="4.1.1" />
<PackageReference Include="LanguageExt.Core" Version="4.2.2" />
<PackageReference Include="LanguageExt.Transformers" Version="4.2.2" />
<PackageReference Include="MediatR" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />

12
ErsatzTV.Core/Scheduling/PlayoutBuildMode.cs

@ -2,12 +2,18 @@ @@ -2,12 +2,18 @@
public enum PlayoutBuildMode
{
// this continues building playout into the future
/// <summary>
/// Continue building the playout into the future, without changing any existing playout items
/// </summary>
Continue = 1,
// this rebuilds a playout but will maintain collection progress
/// <summary>
/// Rebuild the playout while attempting to maintain collection progress
/// </summary>
Refresh = 2,
// this rebuilds a playout and clears all state
/// <summary>
/// Rebuild the playout from scratch (clearing all state)
/// </summary>
Reset = 3
}

2
ErsatzTV.FFmpeg/ErsatzTV.FFmpeg.csproj

@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="CliWrap" Version="3.4.4" />
<PackageReference Include="LanguageExt.Core" Version="4.1.1" />
<PackageReference Include="LanguageExt.Core" Version="4.2.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.1" />
</ItemGroup>

4
ErsatzTV/ErsatzTV.csproj

@ -57,8 +57,8 @@ @@ -57,8 +57,8 @@
<PackageReference Include="Bugsnag.AspNet.Core" Version="3.0.1" />
<PackageReference Include="FluentValidation" Version="11.0.2" />
<PackageReference Include="FluentValidation.AspNetCore" Version="11.0.2" />
<PackageReference Include="HtmlSanitizer" Version="7.1.509" />
<PackageReference Include="LanguageExt.Core" Version="4.1.1" />
<PackageReference Include="HtmlSanitizer" Version="7.1.512" />
<PackageReference Include="LanguageExt.Core" Version="4.2.2" />
<PackageReference Include="Markdig" Version="0.30.2" />
<PackageReference Include="MediatR.Courier.DependencyInjection" Version="5.0.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="10.0.1" />

Loading…
Cancel
Save