Implemented atomic session replacement.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user