playback: fix ongoing sesson logic

Previous might have risked the state being blown up due to cascading
pause changes? Not sure honestly.
This commit is contained in:
Alexander Capehart 2025-03-17 15:20:03 -06:00
parent 93dee00285
commit 6b6fc4d62a
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -435,14 +435,14 @@ class ExoPlaybackStateHolder(
override fun endSession() {
// This session has ended, so we need to reset this flag for when the next
// session starts.
playbackManager.playing(false)
save {
// User could feasibly start playing again if they were fast enough, so
// we need to avoid stopping the foreground state if that's the case.
if (playbackManager.progression.isPlaying) {
playbackManager.playing(false)
if (!playbackManager.progression.isPlaying) {
sessionOngoing = false
playbackManager.ack(this, StateAck.SessionEnded)
}
sessionOngoing = false
playbackManager.ack(this, StateAck.SessionEnded)
}
}