From 335d7822158a4f29bba62350c0647ae2225951c2 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sat, 20 Jun 2026 12:41:30 -0400 Subject: [PATCH] fix(android/player): auto-skip a failed track on load error, not just zero-duration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit onPlayerError fired a `load_failed` event and the snackbar reporter coalesced it into "Skipped N unplayable tracks" — but nothing actually skipped, so a bad/stale track stranded playback while the toast claimed otherwise. Mirror the zero_duration path: advance to the next item and re-prepare (a load error leaves the player IDLE), or stop at the end. Forward-only bounds a fully- unplayable queue. Web parity with 2a8de82a. Issue #968. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../fabledsword/minstrel/player/PlayerController.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 f571f6a9..b84b55b0 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 @@ -417,6 +417,16 @@ class PlayerController @Inject constructor( detail = error.message, ), ) + // A failed load leaves the player IDLE; advance past the bad + // track and re-prepare so one unplayable item doesn't strand + // playback (mirrors the zero_duration skip). Forward-only — + // stop at the end — bounds a fully-unplayable queue. + if (controller.hasNextMediaItem()) { + controller.seekToNextMediaItem() + controller.prepare() + } else { + controller.stop() + } } override fun onMediaItemTransition(