Commit 95e9d976 authored by Geoffrey Métais's avatar Geoffrey Métais

Network browser: Fix favorites disappearing

parent 6cafacc4
......@@ -45,6 +45,9 @@ class NetworkProvider(context: Context, dataset: LiveDataset<MediaLibraryItem>,
override suspend fun browseRootImpl() {
dataset.clear()
dataset.value = mutableListOf<MediaLibraryItem>().apply {
getFavoritesList(favorites?.value)?.let { addAll(it) }
}
if (ExternalMonitor.allowLan()) browse()
}
......@@ -54,9 +57,6 @@ class NetworkProvider(context: Context, dataset: LiveDataset<MediaLibraryItem>,
val list by lazy(LazyThreadSafetyMode.NONE) { getList(url!!) }
when {
url == null -> {
dataset.value = mutableListOf<MediaLibraryItem>().apply {
getFavoritesList(favorites?.value)?.let { addAll(it) }
}
browseRoot()
}
list !== null -> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment