Add bookmark filter (#8198)

* feat: add bookmark filter

* feat: add getBookmarkChaptersByMangaId query + interactor to be used for filtering
This commit is contained in:
Swords
2022-10-16 02:33:09 +11:00
committed by GitHub
parent 3d7e44726d
commit 3fdcd636d7
8 changed files with 57 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
package eu.kanade.domain.chapter.interactor
import eu.kanade.domain.chapter.model.Chapter
import eu.kanade.domain.chapter.repository.ChapterRepository
import eu.kanade.tachiyomi.util.system.logcat
import logcat.LogPriority
class GetBookmarkedChaptersByMangaId(
private val chapterRepository: ChapterRepository,
) {
suspend fun await(mangaId: Long): List<Chapter> {
return try {
chapterRepository.getBookmarkedChaptersByMangaId(mangaId)
} catch (e: Exception) {
logcat(LogPriority.ERROR, e)
emptyList()
}
}
}

View File

@@ -16,6 +16,8 @@ interface ChapterRepository {
suspend fun getChapterByMangaId(mangaId: Long): List<Chapter>
suspend fun getBookmarkedChaptersByMangaId(mangaId: Long): List<Chapter>
suspend fun getChapterById(id: Long): Chapter?
suspend fun getChapterByMangaIdAsFlow(mangaId: Long): Flow<List<Chapter>>