Use SQLDelight for all Chapter related queries (#7440)

This commit is contained in:
Andreas
2022-07-03 00:51:33 +02:00
committed by GitHub
parent 76c0ead1db
commit 29633b64aa
9 changed files with 63 additions and 65 deletions

View File

@@ -17,4 +17,13 @@ class GetChapter(
null
}
}
suspend fun await(url: String, mangaId: Long): Chapter? {
return try {
chapterRepository.getChapterByUrlAndMangaId(url, mangaId)
} catch (e: Exception) {
logcat(LogPriority.ERROR, e)
null
}
}
}

View File

@@ -19,4 +19,6 @@ interface ChapterRepository {
suspend fun getChapterById(id: Long): Chapter?
suspend fun getChapterByMangaIdAsFlow(mangaId: Long): Flow<List<Chapter>>
suspend fun getChapterByUrlAndMangaId(url: String, mangaId: Long): Chapter?
}