Enhance GridScheduleGenerator and related components for improved slot handling and cursor management
ci / build-backend (push) Successful in 1m21s
ci / build-frontend (push) Successful in 51s
ci / tests (push) Successful in 1m40s
ci / sonar (push) Successful in 3m46s

Updated the GridScheduleGenerator to support rebuilding future schedules while correctly managing aired positions. Introduced a new AiredPosition record to track the last aired state of slots, ensuring that the cursor rewinds to the correct position during rebuilds. Refactored the BuildInputAsync method to accept aired positions, and modified the LoadAiredPositionsAsync method for accurate retrieval of past entries. Enhanced the SchedulePlanner to utilize shared cursor states between main and background loops, preventing duplicate series plays. Updated documentation to reflect these changes and added integration tests to verify the correct behavior of the new functionality.
This commit is contained in:
Leonid Pershin
2026-07-29 08:57:46 +03:00
parent c67d1f7752
commit fbfc6e677e
11 changed files with 568 additions and 117 deletions
@@ -121,6 +121,7 @@ public sealed class TransactionIntegrationTests(PostgresFixture fixture)
[SkippableFact]
public async Task DeleteShow_WithSchedule_CutsFutureEntries()
{
Skip.IfNot(fixture.Available, "Docker недоступен");
var channel = Channel.Create("Канал", $"cut-{Guid.NewGuid():N}", DateTimeOffset.UnixEpoch);
var show = Show.Create("Шоу", ShowKind.Single);
var asset = MediaAsset.Register("live.mkv", ".mkv", MediaSource.Upload);
@@ -181,6 +182,7 @@ public sealed class TransactionIntegrationTests(PostgresFixture fixture)
[SkippableFact]
public async Task DeleteShow_WithMedia_RemovesEverything()
{
Skip.IfNot(fixture.Available, "Docker недоступен");
var channel = Channel.Create("Канал", $"del-{Guid.NewGuid():N}", DateTimeOffset.UnixEpoch);
var show = Show.Create("Шоу", ShowKind.Single);
var asset = MediaAsset.Register("movie.mkv", ".mkv", MediaSource.Upload);