Commit 66a7278f authored by Geoffrey Métais's avatar Geoffrey Métais

Set browerprovider actor before init

parent 99f574a5
......@@ -60,6 +60,14 @@ abstract class BrowserProvider(val context: Context, val dataset: LiveDataset<Me
val descriptionUpdate = MutableLiveData<Pair<Int, String>>()
internal val medialibrary = Medialibrary.getInstance()
private val browserActor = actor<BrowserAction>(Dispatchers.IO, Channel.UNLIMITED) {
for (action in channel) when (action) {
is Browse -> browseImpl(action.url)
is Refresh -> refreshImpl()
is ParseSubDirectories -> parseSubDirectoriesImpl()
}
}
init {
fetch()
}
......@@ -225,12 +233,6 @@ abstract class BrowserProvider(val context: Context, val dataset: LiveDataset<Me
fun isFolderEmpty(mw: MediaWrapper) = foldersContentMap[mw]?.isEmpty() ?: true
private val browserActor = actor<BrowserAction>(Dispatchers.IO, Channel.UNLIMITED) { for (action in channel) when (action) {
is Browse -> browseImpl(action.url)
is Refresh -> refreshImpl()
is ParseSubDirectories -> parseSubDirectoriesImpl()
} }
companion object {
private val browserHandler by lazy {
val handlerThread = HandlerThread("vlc-mProvider", Process.THREAD_PRIORITY_DEFAULT + Process.THREAD_PRIORITY_LESS_FAVORABLE)
......
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