diff --git a/rpc/src/main/kotlin/org/equeim/tremotesf/rpc/Servers.kt b/rpc/src/main/kotlin/org/equeim/tremotesf/rpc/Servers.kt index b22f114b..d7d42411 100644 --- a/rpc/src/main/kotlin/org/equeim/tremotesf/rpc/Servers.kt +++ b/rpc/src/main/kotlin/org/equeim/tremotesf/rpc/Servers.kt @@ -8,7 +8,11 @@ import android.content.Context import androidx.annotation.AnyThread import androidx.annotation.MainThread import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.flow.* +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.distinctUntilChanged +import kotlinx.coroutines.flow.map import kotlinx.coroutines.launch import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.SerialName @@ -56,7 +60,10 @@ abstract class Servers( val hasServers: Flow = _serversState.map { it.servers.isNotEmpty() }.distinctUntilChanged() val currentServer: Flow = _serversState.map { it.currentServer }.distinctUntilChanged() - private val json = Json { prettyPrint = true } + private val json = Json { + prettyPrint = true + ignoreUnknownKeys = true + } init { load()