mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-12 03:58:56 +01:00
Add bookmark filter (#8198)
* feat: add bookmark filter * feat: add getBookmarkChaptersByMangaId query + interactor to be used for filtering
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>>
|
||||
|
||||
Reference in New Issue
Block a user