mirror of
https://github.com/mihonapp/mihon.git
synced 2026-10-16 13:48:09 -07:00
Improve performance across screens (#4071)
* Keep screens loaded while they're hidden and rebuild the library faster * Count chapters in SQL for the migration list * Show the extension list sooner and check trust against loaded stores * Cancel the previous tracker search when searching again * Write reader progress less often and keep its work off the main thread * Stop rebuilding the settings search index on every key * Watch updates for widgets only while one is placed The query re-ran on every chapter or manga write even with no widget on the home screen. * Observe download pages and limit how often their progress updates * Throttle the library update notification and write fetch data together
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
package tachiyomi.domain.chapter.interactor
|
||||
|
||||
import dev.zacsweers.metro.Inject
|
||||
import tachiyomi.domain.chapter.model.ChapterSummary
|
||||
import tachiyomi.domain.chapter.repository.ChapterRepository
|
||||
|
||||
@Inject
|
||||
class GetChapterSummaryByMangaId(
|
||||
private val chapterRepository: ChapterRepository,
|
||||
) {
|
||||
|
||||
suspend fun await(mangaId: Long): ChapterSummary {
|
||||
return chapterRepository.getChapterSummaryByMangaId(mangaId)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package tachiyomi.domain.chapter.model
|
||||
|
||||
data class ChapterSummary(
|
||||
val chapterCount: Long,
|
||||
val latestChapterNumber: Double?,
|
||||
)
|
||||
@@ -3,6 +3,7 @@ package tachiyomi.domain.chapter.repository
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import tachiyomi.domain.chapter.model.Chapter
|
||||
import tachiyomi.domain.chapter.model.ChapterRemoteUpdate
|
||||
import tachiyomi.domain.chapter.model.ChapterSummary
|
||||
import tachiyomi.domain.chapter.model.ChapterUpdate
|
||||
|
||||
interface ChapterRepository {
|
||||
@@ -19,6 +20,8 @@ interface ChapterRepository {
|
||||
|
||||
suspend fun getChapterByMangaId(mangaId: Long, applyScanlatorFilter: Boolean = false): List<Chapter>
|
||||
|
||||
suspend fun getChapterSummaryByMangaId(mangaId: Long): ChapterSummary
|
||||
|
||||
suspend fun getScanlatorsByMangaId(mangaId: Long): List<String>
|
||||
|
||||
fun getScanlatorsByMangaIdAsFlow(mangaId: Long): Flow<List<String>>
|
||||
|
||||
Reference in New Issue
Block a user