Fix cover fetching in compose views (#7315)

Make sure it passed thru the custom fetcher

(cherry picked from commit 1b804e61cb)

# Conflicts:
#	app/src/main/java/eu/kanade/data/history/HistoryMapper.kt
#	app/src/main/java/eu/kanade/domain/history/model/HistoryWithRelations.kt
#	app/src/main/java/eu/kanade/tachiyomi/App.kt
This commit is contained in:
Ivan Iskandar
2022-06-18 09:21:29 +07:00
committed by Jobobby04
parent b4d9c36b32
commit a5fe4e1a44
11 changed files with 147 additions and 9 deletions
@@ -2,6 +2,7 @@ package eu.kanade.data.history
import eu.kanade.domain.history.model.History
import eu.kanade.domain.history.model.HistoryWithRelations
import eu.kanade.domain.manga.model.MangaCover
import java.util.Date
val historyMapper: (Long, Long, Date?, Long) -> History = { id, chapterId, readAt, readDuration ->
@@ -13,8 +14,8 @@ val historyMapper: (Long, Long, Date?, Long) -> History = { id, chapterId, readA
)
}
val historyWithRelationsMapper: (Long, Long, Long, String, String?, Float, Date?, Long) -> HistoryWithRelations = {
historyId, mangaId, chapterId, title, thumbnailUrl, chapterNumber, readAt, readDuration ->
val historyWithRelationsMapper: (Long, Long, Long, String, String?, Long, Boolean, Long, Float, Date?, Long) -> HistoryWithRelations = {
historyId, mangaId, chapterId, title, thumbnailUrl, sourceId, isFavorite, coverLastModified, chapterNumber, readAt, readDuration ->
HistoryWithRelations(
id = historyId,
chapterId = chapterId,
@@ -22,9 +23,15 @@ val historyWithRelationsMapper: (Long, Long, Long, String, String?, Float, Date?
// SY -->
ogTitle = title,
// SY <--
thumbnailUrl = thumbnailUrl ?: "",
chapterNumber = chapterNumber,
readAt = readAt,
readDuration = readDuration,
coverData = MangaCover(
mangaId = mangaId,
sourceId = sourceId,
isMangaFavorite = isFavorite,
url = thumbnailUrl,
lastModified = coverLastModified,
),
)
}