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

View File

@@ -28,8 +28,8 @@ val mangaMapper: (Long, Long, String, String?, String?, String?, List<String>?,
)
}
val libraryManga: (Long, Long, String, String?, String?, String?, List<String>?, String, Long, String?, Boolean, Long?, Long?, Boolean, Long, Long, Long, Long, UpdateStrategy, Long, Long, Long, Long, Long, Long) -> LibraryManga =
{ id, source, url, artist, author, description, genre, title, status, thumbnailUrl, favorite, lastUpdate, nextUpdate, initialized, viewerFlags, chapterFlags, coverLastModified, dateAdded, updateStrategy, unreadCount, readCount, latestUpload, chapterFetchedAt, lastRead, category ->
val libraryManga: (Long, Long, String, String?, String?, String?, List<String>?, String, Long, String?, Boolean, Long?, Long?, Boolean, Long, Long, Long, Long, UpdateStrategy, Long, Long, Long, Long, Long, Long, Long) -> LibraryManga =
{ id, source, url, artist, author, description, genre, title, status, thumbnailUrl, favorite, lastUpdate, nextUpdate, initialized, viewerFlags, chapterFlags, coverLastModified, dateAdded, updateStrategy, totalCount, readCount, latestUpload, chapterFetchedAt, lastRead, bookmarkCount, category ->
LibraryManga(
manga = mangaMapper(
id,
@@ -53,8 +53,9 @@ val libraryManga: (Long, Long, String, String?, String?, String?, List<String>?,
updateStrategy,
),
category = category,
unreadCount = unreadCount,
totalChapters = totalCount,
readCount = readCount,
bookmarkCount = bookmarkCount,
latestUpload = latestUpload,
chapterFetchedAt = chapterFetchedAt,
lastRead = lastRead,