From d35fb0130694ec57219dcb9a140ddc8541018568 Mon Sep 17 00:00:00 2001 From: Honey Date: Mon, 10 Aug 2026 20:22:09 +0200 Subject: [PATCH] =?UTF-8?q?fix(android=20auto):=20tapping=20a=20song=20(e.?= =?UTF-8?q?g.=20in=20Favoriten)=20did=20nothing=20=E2=80=94=20re-attach=20?= =?UTF-8?q?stream=20URI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Android Auto strips a MediaItem's URI (localConfiguration) when a browse-tree item crosses the process boundary, so onAddMediaItems received the tapped song without a playable URI and the else branch passed it through unchanged → no playback. Rebuild the item with the stream URI resolved from its mediaId. Co-Authored-By: Claude Opus 4.8 --- .../main/kotlin/com/novasonic/app/player/MusicService.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/kotlin/com/novasonic/app/player/MusicService.kt b/android/app/src/main/kotlin/com/novasonic/app/player/MusicService.kt index 64fc3ae..c9f13df 100644 --- a/android/app/src/main/kotlin/com/novasonic/app/player/MusicService.kt +++ b/android/app/src/main/kotlin/com/novasonic/app/player/MusicService.kt @@ -385,7 +385,13 @@ class MusicService : MediaLibraryService() { val pl = repo.getPlaylist(item.mediaId.removePrefix(ITEM_PREFIX_PL)) pl.entry.map { song -> song.toMediaItem(repo) } } - else -> listOf(item) + // A tapped song (e.g. in Favoriten): Android Auto strips the URI + // (localConfiguration) when the browse item crosses the process boundary, + // so it comes back unplayable → nothing happens. Re-attach the stream URI. + else -> { + val uri = repo.streamUrl(item.mediaId)?.let { android.net.Uri.parse(it) } + listOf(item.buildUpon().setUri(uri).build()) + } } } settable.set(resolved.toMutableList())