Implemented atomic session replacement.

This commit is contained in:
Dmitry Sergeev
2026-09-01 01:22:03 +03:00
parent e830da4a32
commit 047f334413
6 changed files with 108 additions and 27 deletions
+10 -2
View File
@@ -20,11 +20,13 @@ const (
CommandRemoveAudio
CommandEnableSync
CommandDisableSync
CommandSetSession
)
type SessionCommand struct {
Kind SessionCommandKind
Config FeedConfig // Used only by SetVideo and SetAudio.
Kind SessionCommandKind
Config FeedConfig // Used only by SetVideo and SetAudio.
Session SessionConfig // Used only by SetSession.
}
var (
@@ -99,6 +101,12 @@ func ApplySessionCommand(
case CommandDisableSync:
next.SyncRequested = false
case CommandSetSession:
next = command.Session
// Retry policy belongs to the running controller configuration, not to
// GUI or playlist session selections.
next.Retry = current.Retry
default:
return current, ErrUnknownSessionCommand
}