Fallback to suggested music when no search results are found in Android Auto voice search

This commit is contained in:
Niels van Velzen
2026-07-23 18:39:18 +02:00
committed by Niels van Velzen
parent 6d13b31397
commit 630c6fe410
@@ -383,6 +383,17 @@ class SessionBrowserCallback(
?.getContent(route, 0, MAX_PAGE_SIZE)
?.toMediaItems(route)
.orEmpty()
// Android Auto does not support session error reporting
// but Google Play requires feedback on all search requests
// so fallback to random item playback if no search results are found
if (expandedItems.isEmpty()) {
@Suppress("UNCHECKED_CAST")
expandedItems = (LibraryRoute.Suggested.page as LibraryPage<LibraryRoute>)
.getContent(LibraryRoute.Suggested, 0, MAX_PAGE_SIZE)
.toMediaItems(route)
}
newStartIndex = 0
}