[Android] Remote access: improve the history content

Nicolas Pomepuy git at videolan.org
Tue Jun 25 15:55:43 UTC 2024


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Jun 25 09:55:21 2024 +0200| [36346034e93681a8d72f46eb4d5ef268dca7f428] | committer: Duncan McNamara

Remote access: improve the history content

> https://code.videolan.org/videolan/vlc-android/commit/36346034e93681a8d72f46eb4d5ef268dca7f428
---

 .../src/main/java/org/videolan/vlc/webserver/RemoteAccessRouting.kt   | 4 +++-
 .../src/main/java/org/videolan/vlc/webserver/RemoteAccessServer.kt    | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessRouting.kt b/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessRouting.kt
index 47d1cb22ae..69ba9b09c7 100644
--- a/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessRouting.kt
+++ b/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessRouting.kt
@@ -765,7 +765,9 @@ fun Route.setupRouting(appContext: Context, scope: CoroutineScope) {
                 withContext(Dispatchers.Default) {
                     appContext.getFromMl {
                         history(
-                            Medialibrary.HISTORY_TYPE_LOCAL).toMutableList().map { it.toPlayQueueItem(if (it.type == MediaWrapper.TYPE_VIDEO) Tools.millisToText(it.length) else "") }
+                            Medialibrary.HISTORY_TYPE_LOCAL).toMutableList().map { it.toPlayQueueItem(" ").apply {
+                            if (it.type == MediaWrapper.TYPE_VIDEO) fileType = "video"
+                        } }
                     }
                 }
             } catch (e: Exception) {
diff --git a/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessServer.kt b/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessServer.kt
index 7c93923e1d..4ffc1be8be 100644
--- a/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessServer.kt
+++ b/application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessServer.kt
@@ -747,7 +747,7 @@ class RemoteAccessServer(private val context: Context) : PlaybackService.Callbac
     data class WSBookmark(val title: String, val time: Long)
 
     data class PlayQueue(val medias: List<PlayQueueItem>) : WSMessage("play-queue")
-    data class PlayQueueItem(val id: Long, val title: String, val artist: String, val length: Long, val artworkURL: String, val playing: Boolean, val resolution: String = "", val path: String = "", val isFolder: Boolean = false, val progress: Long = 0L, val played: Boolean = false, val fileType: String = "", val videoType: String? = null, val favorite: Boolean = false)
+    data class PlayQueueItem(val id: Long, val title: String, val artist: String, val length: Long, val artworkURL: String, val playing: Boolean, val resolution: String = "", val path: String = "", val isFolder: Boolean = false, val progress: Long = 0L, val played: Boolean = false, var fileType: String = "", val videoType: String? = null, val favorite: Boolean = false)
     data class WebSocketAuthorization(val status:String, val initialMessage:String) : WSMessage("auth")
     data class Volume(val volume: Int) : WSMessage("volume")
     data class PlayerStatus(val playing: Boolean) : WSMessage("player-status")



More information about the Android mailing list