[Android] Remote access: fix search null response and play-all background return
Nicolas Pomepuy
git at videolan.org
Thu Sep 10 04:41:21 UTC 2026
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Sep 9 14:48:56 2026 +0200| [bc73f0a981fb02b6b85730185317df382e27a13a] | committer: Nicolas Pomepuy
Remote access: fix search null response and play-all background return
> https://code.videolan.org/videolan/vlc-android/commit/bc73f0a981fb02b6b85730185317df382e27a13a
---
.../vlc/remoteaccessserver/routing/RemoteAccessRoutingPlayback.kt | 1 +
.../vlc/remoteaccessserver/routing/RemoteAccessRoutingSearch.kt | 8 ++++----
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/application/remote-access-server/src/main/java/org/videolan/vlc/remoteaccessserver/routing/RemoteAccessRoutingPlayback.kt b/application/remote-access-server/src/main/java/org/videolan/vlc/remoteaccessserver/routing/RemoteAccessRoutingPlayback.kt
index e4e782bd93..64b2be6d5e 100644
--- a/application/remote-access-server/src/main/java/org/videolan/vlc/remoteaccessserver/routing/RemoteAccessRoutingPlayback.kt
+++ b/application/remote-access-server/src/main/java/org/videolan/vlc/remoteaccessserver/routing/RemoteAccessRoutingPlayback.kt
@@ -236,6 +236,7 @@ fun Route.playbackRouting(appContext: Context, scope: CoroutineScope, settings:
}
if (medias[0].type == MediaWrapper.TYPE_VIDEO && !appContext.awaitAppIsForegroung()) {
call.respond(HttpStatusCode.Forbidden, appContext.getString(R.string.ra_not_in_foreground))
+ return at get
}
MediaUtils.openList(appContext, medias.toList(), 0)
call.respond(HttpStatusCode.OK)
diff --git a/application/remote-access-server/src/main/java/org/videolan/vlc/remoteaccessserver/routing/RemoteAccessRoutingSearch.kt b/application/remote-access-server/src/main/java/org/videolan/vlc/remoteaccessserver/routing/RemoteAccessRoutingSearch.kt
index 1ef5b35229..2ceecc5d04 100644
--- a/application/remote-access-server/src/main/java/org/videolan/vlc/remoteaccessserver/routing/RemoteAccessRoutingSearch.kt
+++ b/application/remote-access-server/src/main/java/org/videolan/vlc/remoteaccessserver/routing/RemoteAccessRoutingSearch.kt
@@ -56,8 +56,8 @@ fun Route.searchRouting(appContext: Context, settings: SharedPreferences) {
call.request.queryParameters["search"]?.let { query ->
val searchAggregate = appContext.getFromMl { search(query, Settings.includeMissing, false) }
- searchAggregate?.let { result ->
- val results = RemoteAccessServer.SearchResults(
+ val results = searchAggregate?.let { result ->
+ RemoteAccessServer.SearchResults(
result.albums?.filterNotNull()?.map { it.toPlayQueueItem() }
?: listOf(),
result.artists?.filterNotNull()?.map { it.toPlayQueueItem(appContext) }
@@ -71,8 +71,8 @@ fun Route.searchRouting(appContext: Context, settings: SharedPreferences) {
result.tracks?.filterNotNull()?.map { it.toPlayQueueItem() }
?: listOf(),
)
- call.respondJson(convertToJson(results))
- }
+ } ?: RemoteAccessServer.SearchResults(listOf(), listOf(), listOf(), listOf(), listOf(), listOf())
+ call.respondJson(convertToJson(results))
return at get
}
call.respondJson(convertToJson(RemoteAccessServer.SearchResults(listOf(), listOf(), listOf(), listOf(), listOf(), listOf())))
More information about the Android
mailing list