Remove usage of PublishRelay in DownloadQueue

This commit is contained in:
arkon
2022-11-26 10:07:51 -05:00
parent 5c9e9bd2c4
commit 37118088d4
4 changed files with 24 additions and 15 deletions
@@ -34,7 +34,7 @@ class DownloadPresenter : BasePresenter<DownloadController>() {
super.onCreate(savedState)
presenterScope.launch {
downloadQueue.updatedFlow()
downloadQueue.updates
.catch { logcat(LogPriority.ERROR, it) }
.map { downloads ->
downloads
@@ -69,7 +69,7 @@ private class MoreScreenModel(
coroutineScope.launchIO {
combine(
DownloadService.isRunning,
downloadManager.queue.updatedFlow(),
downloadManager.queue.updates,
) { isRunning, downloadQueue -> Pair(isRunning, downloadQueue.size) }
.collectLatest { (isDownloading, downloadQueueSize) ->
val pendingDownloadExists = downloadQueueSize != 0