From 41da01249411ecbf5a70d7a90c363d8ac8c2a827 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sat, 6 Jun 2026 17:29:58 -0400 Subject: [PATCH] fix(android): failed UPnP play reverts to phone and resumes locally --- .../minstrel/player/output/OutputPickerController.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/java/com/fabledsword/minstrel/player/output/OutputPickerController.kt b/android/app/src/main/java/com/fabledsword/minstrel/player/output/OutputPickerController.kt index e322dd0f..bef9838b 100644 --- a/android/app/src/main/java/com/fabledsword/minstrel/player/output/OutputPickerController.kt +++ b/android/app/src/main/java/com/fabledsword/minstrel/player/output/OutputPickerController.kt @@ -429,7 +429,10 @@ class OutputPickerController @Inject constructor( */ private fun handleRemoteDrop() { val capturedPositionMs = remoteState.positionMs - val wasPlayingRemote = remoteState.isPlaying + // Resume on the operator's last play-intent, not the observed remote + // state: after a pause, isPlaying is false, but a failed play() that + // triggered this drop means the operator DID ask to play -- honor it. + val wasPlayingRemote = remoteState.lastPlayIntent activeUpnpHolder.set(null) activeUpnpHolder.setTarget(null) selectedUpnpRouteIdInternal.value = null @@ -552,6 +555,9 @@ class OutputPickerController @Inject constructor( rendering = rendering, ), ) + // Selecting a route loads the queue and Plays on the renderer, so + // the standing intent is "play" -- a later drop should resume local. + remoteState.setPlayIntent(true) }.onFailure { e -> Timber.w(e, "UPnP select failed for route ${effectiveRoute.id}") activeUpnpHolder.set(null)