Restore broken covers and bookmark previews

This commit is contained in:
Koitharu
2023-08-18 16:52:14 +03:00
parent df04dcc8a3
commit ead8a3d6df
10 changed files with 141 additions and 3 deletions

View File

@@ -52,6 +52,13 @@ class BookmarksRepository @Inject constructor(
}
}
suspend fun updateBookmark(bookmark: Bookmark, imageUrl: String) {
val entity = bookmark.toEntity().copy(
imageUrl = imageUrl,
)
db.bookmarksDao.upsert(listOf(entity))
}
suspend fun removeBookmark(mangaId: Long, chapterId: Long, page: Int) {
check(db.bookmarksDao.delete(mangaId, chapterId, page) != 0) {
"Bookmark not found"

View File

@@ -34,6 +34,7 @@ fun bookmarkListAD(
fallback(R.drawable.ic_placeholder)
error(R.drawable.ic_error_placeholder)
allowRgb565(true)
tag(item)
decodeRegion(item.scroll)
source(item.manga.source)
enqueueWith(coil)

View File

@@ -35,6 +35,7 @@ fun bookmarkLargeAD(
fallback(R.drawable.ic_placeholder)
error(R.drawable.ic_error_placeholder)
allowRgb565(true)
tag(item)
decodeRegion(item.scroll)
source(item.manga.source)
enqueueWith(coil)