Use SQLDelight for a Category related queries (#7438)

This commit is contained in:
Andreas
2022-07-02 22:12:06 +02:00
committed by GitHub
parent 21771e62aa
commit 2674570792
14 changed files with 96 additions and 99 deletions
@@ -372,9 +372,9 @@ open class BrowseSourcePresenter(
* @param manga the manga to get categories from.
* @return Array of category ids the manga is in, if none returns default id
*/
fun getMangaCategoryIds(manga: Manga): Array<Long?> {
val categories = db.getCategoriesForManga(manga.id!!).executeAsBlocking()
return categories.mapNotNull { it?.id?.toLong() }.toTypedArray()
suspend fun getMangaCategoryIds(manga: Manga): Array<Long?> {
val categories = getCategories.await(manga.id!!)
return categories.map { it.id }.toTypedArray()
}
/**