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

View File

@@ -93,14 +93,13 @@ object UpdateController {
if (clear) {
updater.reset()
}
categories
.flatMap { CategoryManga.getCategoryMangaList(it.id) }
.distinctBy { it.id }
.sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER, MangaDataClass::title))
.filter { it.updateStrategy == UpdateStrategy.ALWAYS_UPDATE }
.forEach { manga ->
updater.addMangaToQueue(manga)
}
updater.addMangasToQueue(
categories
.flatMap { CategoryManga.getCategoryMangaList(it.id) }
.distinctBy { it.id }
.sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER, MangaDataClass::title))
.filter { it.updateStrategy == UpdateStrategy.ALWAYS_UPDATE }
)
}
fun categoryUpdateWS(ws: WsConfig) {