Skip to content
Snippets Groups Projects
Commit 95e9d976 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Network browser: Fix favorites disappearing

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