Emit update to clients after adding all mangas to the queue (#521)

Emitting updates before all the mangas were added to the queue could lead to e.g. wrong progress calculation.
This commit is contained in:
schroda
2023-03-25 19:38:42 +01:00
committed by GitHub
parent 5b61bdc3a8
commit dcde4947e8
4 changed files with 17 additions and 14 deletions
@@ -13,8 +13,8 @@ class TestUpdater : IUpdater {
private val _status = MutableStateFlow(UpdateStatus())
override val status: StateFlow<UpdateStatus> = _status.asStateFlow()
override fun addMangaToQueue(manga: MangaDataClass) {
updateQueue.add(UpdateJob(manga))
override fun addMangasToQueue(mangas: List<MangaDataClass>) {
mangas.forEach { updateQueue.add(UpdateJob(it)) }
isRunning = true
updateStatus()
}