fix(android): polling tick track update is forward-only so user Next isn't undone
android / Build + lint + test (push) Successful in 3m27s
android / Build + lint + test (push) Successful in 3m27s
This commit is contained in:
@@ -525,7 +525,11 @@ class PlayerController @Inject constructor(
|
|||||||
val newPos = effectivePosition.coerceAtLeast(0)
|
val newPos = effectivePosition.coerceAtLeast(0)
|
||||||
val newDur = effectiveDuration(upnpActive, remoteState.durationMs, controller.duration)
|
val newDur = effectiveDuration(upnpActive, remoteState.durationMs, controller.duration)
|
||||||
val newBuf = controller.bufferedPosition.coerceAtLeast(0)
|
val newBuf = controller.bufferedPosition.coerceAtLeast(0)
|
||||||
val trackChanged = desiredIdx != current.queueIndex && desiredIdx in queueRefs.indices
|
// Forward-only. If desiredIdx < queueIndex, the user just pressed Next
|
||||||
|
// and Sonos's poll hasn't caught up yet -- walking backward would undo
|
||||||
|
// their press (logcat 2026-06-04 showed exactly that jump-back-then-
|
||||||
|
// forward cycle). Mirrors maybeSyncLocalCursor's forward-only policy.
|
||||||
|
val trackChanged = desiredIdx > current.queueIndex && desiredIdx in queueRefs.indices
|
||||||
val somethingChanged = trackChanged ||
|
val somethingChanged = trackChanged ||
|
||||||
current.isPlaying != effectiveIsPlaying ||
|
current.isPlaying != effectiveIsPlaying ||
|
||||||
current.positionMs != newPos ||
|
current.positionMs != newPos ||
|
||||||
|
|||||||
Reference in New Issue
Block a user