automatic playlist timing into PlaylistController

This commit is contained in:
Dmitry Sergeev
2026-09-01 20:16:07 +03:00
parent 1e21da0aac
commit d3ea99233d
3 changed files with 429 additions and 6 deletions
@@ -173,7 +173,7 @@ func TestPlaylistControllerCommitsStateAfterSessionDelivery(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
result := make(chan error, 1)
go func() { result <- controller.Run(ctx, commands) }()
go func() { result <- controller.Run(ctx, commands, nil) }()
waitForPlaylistSnapshot(t, controller, func(snapshot PlaylistSnapshot) bool {
return !snapshot.State.HasSelection
@@ -224,7 +224,7 @@ func TestPlaylistControllerCancellationWhileSending(t *testing.T) {
commands := make(chan PlaylistCommand, 1)
ctx, cancel := context.WithCancel(context.Background())
result := make(chan error, 1)
go func() { result <- controller.Run(ctx, commands) }()
go func() { result <- controller.Run(ctx, commands, nil) }()
commands <- PlaylistCommand{Kind: PlaylistNext}
cancel()
@@ -323,7 +323,7 @@ func startPlaylistController(
commands := make(chan PlaylistCommand, 64)
ctx, cancel := context.WithCancel(context.Background())
result := make(chan error, 1)
go func() { result <- controller.Run(ctx, commands) }()
go func() { result <- controller.Run(ctx, commands, nil) }()
return controller, commands, sessions, cancel, result
}