From e6c3c959faa1215c92c47da58d9218e43194fb75 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 3 Jun 2026 22:25:53 -0400 Subject: [PATCH] fix(android): handleZeroDurationIfNeeded ReturnCount within cap --- .../java/com/fabledsword/minstrel/player/PlayerController.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/java/com/fabledsword/minstrel/player/PlayerController.kt b/android/app/src/main/java/com/fabledsword/minstrel/player/PlayerController.kt index 15e3e7fa..0b3aaa98 100644 --- a/android/app/src/main/java/com/fabledsword/minstrel/player/PlayerController.kt +++ b/android/app/src/main/java/com/fabledsword/minstrel/player/PlayerController.kt @@ -326,8 +326,8 @@ class PlayerController @Inject constructor( // buffers tracks, so duration is permanently 0 / TIME_UNSET -- without // this guard we rapid-advance through the entire local queue (and spam // /api/playback-errors) every time the user activates a UPnP route. - if (activeUpnpHolder.active.value != null) return - val current = queueRefs.getOrNull(idx) ?: return + val current = queueRefs.getOrNull(idx) + if (current == null || activeUpnpHolder.active.value != null) return val duration = controller.duration val isZeroDuration = duration <= 0L || duration == androidx.media3.common.C.TIME_UNSET if (!isZeroDuration) return