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

Browser: Fix race condition at initial load

parent eeda400b
No related branches found
No related tags found
No related merge requests found
Pipeline #7695 passed with stage
in 3 minutes and 46 seconds
......@@ -76,10 +76,6 @@ abstract class BrowserProvider(val context: Context, val dataset: LiveDataset<Me
} else channel.close()
}
init {
fetch()
}
protected open fun initBrowser() {
if (mediabrowser == null) mediabrowser = MediaBrowser(VLCInstance.get(context), this, browserHandler)
}
......
......@@ -55,7 +55,8 @@ open class FileBrowserProvider(
private var storagePosition = -1
private var otgPosition = -1
private val showFavorites : Boolean
@Suppress("LeakingThis")
private val showFavorites = url == null && !filePicker && this !is StorageProvider
private val favorites = if (url == null && !filePicker) BrowserFavRepository.getInstance(context).localFavorites else null
private val favoritesObserver by lazy { Observer<List<BrowserFav>> {
......@@ -88,7 +89,7 @@ open class FileBrowserProvider(
} }
init {
showFavorites = url == null && !filePicker && this !is StorageProvider
fetch()
}
private lateinit var storageObserver : Observer<Boolean>
......
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