Tweak library view (#8240)

- Move category join to improve performance
- Move bookmark calculation into query
- Move unread calculation into domain
This commit is contained in:
Andreas
2022-10-18 22:33:26 +02:00
committed by GitHub
parent 2d19729869
commit 8d97b980e3
8 changed files with 56 additions and 43 deletions
@@ -5,15 +5,20 @@ import eu.kanade.domain.manga.model.Manga
data class LibraryManga(
val manga: Manga,
val category: Long,
val unreadCount: Long,
val totalChapters: Long,
val readCount: Long,
val bookmarkCount: Long,
val latestUpload: Long,
val chapterFetchedAt: Long,
val lastRead: Long,
) {
val id: Long = manga.id
val totalChapters = readCount + unreadCount
val unreadCount
get() = totalChapters - readCount
val hasBookmarks
get() = bookmarkCount > 0
val hasStarted = readCount > 0
}