playlist timer pause/resume without affecting active feeds
This commit is contained in:
@@ -102,6 +102,36 @@ func (c *PlaylistController) Run(
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
if command.Kind == PlaylistPause {
|
||||
nextTiming, changed := PausePlaylistTiming(
|
||||
timing,
|
||||
revision,
|
||||
c.now(),
|
||||
)
|
||||
if changed {
|
||||
stopTimer()
|
||||
timing = nextTiming
|
||||
c.publish(state, revision, timing)
|
||||
}
|
||||
continue
|
||||
}
|
||||
if command.Kind == PlaylistResume {
|
||||
nextTiming, changed := ResumePlaylistTiming(
|
||||
timing,
|
||||
revision,
|
||||
c.now(),
|
||||
)
|
||||
if changed {
|
||||
timing = nextTiming
|
||||
if timing.Started {
|
||||
timerRevision = timing.Revision
|
||||
timer = c.newTimer(timing.Remaining)
|
||||
timerC = timer.C()
|
||||
}
|
||||
c.publish(state, revision, timing)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
next, sessionCommand, apply, err := ApplyPlaylistSelection(
|
||||
c.playlist,
|
||||
@@ -132,6 +162,14 @@ func (c *PlaylistController) Run(
|
||||
readiness = nil
|
||||
continue
|
||||
}
|
||||
if timing.Paused &&
|
||||
ready.Revision == timing.Revision &&
|
||||
timing.Duration > 0 &&
|
||||
!timing.Expired {
|
||||
timing.Ready = true
|
||||
c.publish(state, revision, timing)
|
||||
continue
|
||||
}
|
||||
nextTiming, started := StartPlaylistTiming(
|
||||
timing,
|
||||
ready.Revision,
|
||||
|
||||
Reference in New Issue
Block a user