Handle async cache in updates and manga screens

- Also fix concurrent accesses to main cache map
- Also debounce sources and updates list updates to maybe avoid crashing due to dupe LazyColumn keys
This commit is contained in:
arkon
2022-10-22 10:50:44 -04:00
parent d558f9e1d6
commit 152eb5b951
7 changed files with 64 additions and 69 deletions
@@ -34,7 +34,7 @@ class DownloadPresenter : BasePresenter<DownloadController>() {
super.onCreate(savedState)
presenterScope.launch {
downloadQueue.getUpdatedAsFlow()
downloadQueue.updatedFlow()
.catch { error -> logcat(LogPriority.ERROR, error) }
.map { downloads ->
downloads
@@ -49,9 +49,9 @@ class DownloadPresenter : BasePresenter<DownloadController>() {
}
}
fun getDownloadStatusFlow() = downloadQueue.getStatusAsFlow()
fun getDownloadStatusFlow() = downloadQueue.statusFlow()
fun getDownloadProgressFlow() = downloadQueue.getProgressAsFlow()
fun getDownloadProgressFlow() = downloadQueue.progressFlow()
/**
* Pauses the download queue.