Reimplement chapter download indicator longpress (#7412)

This commit is contained in:
AntsyLich
2022-07-02 22:43:18 +06:00
committed by GitHub
parent f3c50ee9a3
commit deaded5af2
8 changed files with 169 additions and 4 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 GetChapter(
private val chapterRepository: ChapterRepository,
) {
suspend fun await(id: Long): Chapter? {
return try {
chapterRepository.getChapterById(id)
} catch (e: Exception) {
logcat(LogPriority.ERROR, e)
null
}
}
}

View File

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