Fix default category showing up in edit manga categories list

Also remove some usages of runBlocking
This commit is contained in:
arkon
2022-08-07 11:00:51 -04:00
parent 3c2e237d63
commit 3bc6b1e202
8 changed files with 36 additions and 43 deletions
@@ -389,7 +389,7 @@ open class BrowseSourcePresenter(
suspend fun getCategories(): List<DomainCategory> {
return getCategories.subscribe()
.firstOrNull()
?.filterNot { it.id == DomainCategory.UNCATEGORIZED_ID }
?.filterNot { it.isSystemCategory }
?: emptyList()
}
@@ -32,14 +32,6 @@ import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import uy.kohesive.injekt.injectLazy
/**
* Presenter of [GlobalSearchController]
* Function calls should be done from here. UI calls should be done from the controller.
*
* @param sourceManager manages the different sources.
* @param db manages the database calls.
* @param preferences manages the preference calls.
*/
open class GlobalSearchPresenter(
private val initialQuery: String? = "",
private val initialExtensionFilter: String? = null,
@@ -256,7 +248,7 @@ open class GlobalSearchPresenter(
val networkManga = source.getMangaDetails(manga.toMangaInfo())
manga.copyFrom(networkManga.toSManga())
manga.initialized = true
runBlocking { updateManga.await(manga.toDomainManga()!!.toMangaUpdate()) }
updateManga.await(manga.toDomainManga()!!.toMangaUpdate())
return manga
}