Update explore fragment

This commit is contained in:
Koitharu
2023-07-13 16:08:09 +03:00
parent 55ca2b8d8d
commit 44a2b6db11
10 changed files with 123 additions and 93 deletions

View File

@@ -10,7 +10,6 @@ import org.koitharu.kotatsu.core.db.entity.toMangaTags
import org.koitharu.kotatsu.core.util.ext.mapItems
import org.koitharu.kotatsu.parsers.model.Manga
import org.koitharu.kotatsu.suggestions.data.SuggestionEntity
import org.koitharu.kotatsu.suggestions.data.SuggestionWithManga
import javax.inject.Inject
class SuggestionRepository @Inject constructor(
@@ -29,8 +28,10 @@ class SuggestionRepository @Inject constructor(
}
}
suspend fun getRandom(): SuggestionWithManga? {
return db.suggestionDao.getRandom()
suspend fun getRandom(): Manga? {
return db.suggestionDao.getRandom()?.let {
it.manga.toManga(it.tags.toMangaTags())
}
}
suspend fun clear() {