feat(schedule): add a button to stop the current item

"Aktuelles Element stoppen" in the now-playing card sets the length of
the item on air to the time from its start until now, so the next item
starts at once. Brings back ScheduleController.EndCurrentNow and its
tests; the separate start/stop button stays removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
fraujulianandClaude Opus 5.5 committed 2026-11-27 08:15:14 +01:00
1 parent 6c3396ab4d
commit a47da65f3d
7 files changed
+73 -1

No files matched your search

@@ -265,6 +265,32 @@ public sealed class ScheduleControllerTests : IDisposable
return (controller, started);
}
[Fact]
public async Task EndCurrentNow_EndsTheItemOnAirAndStartsTheNext()
{
var (controller, started) = await OnAirWithTheFirstNewsAsync();
_now = _now.AddMinutes(2);
var plan = controller.EndCurrentNow();
Assert.Equal(TimeSpan.FromMinutes(2), plan[0].Duration);
AssertContiguousFrom(plan, plan[0].Start);
Assert.Equal(_now, plan[1].Start);
Assert.True(await started.WaitAsync(TimeSpan.FromSeconds(5)));
Assert.Equal(1, controller.CurrentIndex);
controller.Stop();
}
[Fact]
public void EndCurrentNow_WithNothingOnAirThrows()
{
AddSongs();
var controller = Create();
controller.CreatePlan(1);
Assert.Throws<ScheduleException>(() => controller.EndCurrentNow());
}
[Fact]
public async Task EditItem_ChangesTheItemOnAirButItCannotBeRemoved()
{