Browse Source

Add logs to the remote server state

merge-requests/2174/head
Nicolas Pomepuy 1 year ago
committed by Duncan McNamara
parent
commit
2fd95965ca
  1. 4
      application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessServer.kt

4
application/webserver/src/main/java/org/videolan/vlc/webserver/RemoteAccessServer.kt

@ -192,6 +192,7 @@ class RemoteAccessServer(private val context: Context) : PlaybackService.Callbac
releaseCallbacks()
}
.launchIn(AppScope)
Log.i(TAG, "Server stopped")
_serverStatus.postValue(ServerStatus.STOPPED)
settings = Settings.getInstance(context)
}
@ -203,6 +204,7 @@ class RemoteAccessServer(private val context: Context) : PlaybackService.Callbac
*/
suspend fun start() {
clearFileDownloads()
Log.i(TAG, "Server connecting")
_serverStatus.postValue(ServerStatus.CONNECTING)
scope.launch {
engine = generateServer()
@ -229,6 +231,7 @@ class RemoteAccessServer(private val context: Context) : PlaybackService.Callbac
*/
suspend fun stop() {
clearFileDownloads()
Log.i(TAG, "Server stopping")
_serverStatus.postValue(ServerStatus.STOPPING)
withContext(Dispatchers.IO) {
RemoteAccessWebSockets.closeAllSessions()
@ -502,6 +505,7 @@ class RemoteAccessServer(private val context: Context) : PlaybackService.Callbac
}.apply {
environment.monitor.subscribe(ApplicationStarted) {
_serverStatus.postValue(ServerStatus.STARTED)
Log.i(TAG, "Server started")
AppScope.launch(Dispatchers.Main) {
PlaylistManager.showAudioPlayer.observeForever(miniPlayerObserver)
DialogActivity.loginDialogShown.observeForever(loginObserver)

Loading…
Cancel
Save