mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-09 19:55:11 +01:00
Setting cover in reader sets the custom cover flag
This commit is contained in:
parent
6533689539
commit
8d88d1a739
@ -690,13 +690,12 @@ class MangaDetailsController : BaseController,
|
||||
menu.findItem(R.id.action_mark_all_as_read).isVisible =
|
||||
presenter.getNextUnreadChapter() != null && !presenter.isLockedFromSearch
|
||||
menu.findItem(R.id.action_mark_all_as_unread).isVisible =
|
||||
!presenter.allUnread() && !presenter.isLockedFromSearch
|
||||
presenter.anyUnread() && !presenter.isLockedFromSearch
|
||||
menu.findItem(R.id.action_remove_downloads).isVisible =
|
||||
presenter.hasDownloads() && !presenter.isLockedFromSearch &&
|
||||
manga?.source != LocalSource.ID
|
||||
menu.findItem(R.id.remove_non_bookmarked).isVisible =
|
||||
presenter.hasBookmark() && !presenter.isLockedFromSearch
|
||||
menu.findItem(R.id.action_mark_all_as_unread).isVisible = presenter.isTracked()
|
||||
menu.findItem(R.id.action_migrate).isVisible = !presenter.isLockedFromSearch &&
|
||||
manga?.source != LocalSource.ID && presenter.manga.favorite
|
||||
menu.findItem(R.id.action_migrate).title = view?.context?.getString(R.string.migrate_,
|
||||
|
@ -319,7 +319,7 @@ class MangaDetailsPresenter(
|
||||
return chapters.sortedByDescending { it.source_order }.find { !it.read }
|
||||
}
|
||||
|
||||
fun allUnread(): Boolean = chapters.none { it.read }
|
||||
fun anyUnread(): Boolean = chapters.any { !it.read }
|
||||
fun hasBookmark(): Boolean = chapters.any { it.bookmark }
|
||||
fun hasDownloads(): Boolean = chapters.any { it.isDownloaded }
|
||||
|
||||
|
@ -535,7 +535,11 @@ class ReaderPresenter(
|
||||
} else {
|
||||
val thumbUrl = manga.thumbnail_url ?: throw Exception("Image url not found")
|
||||
if (manga.favorite) {
|
||||
coverCache.copyToCache(thumbUrl, stream())
|
||||
if (!manga.hasCustomCover()) {
|
||||
manga.thumbnail_url = "Custom-${manga.thumbnail_url ?: manga.id!!}"
|
||||
db.insertManga(manga).executeAsBlocking()
|
||||
}
|
||||
coverCache.copyToCache(manga.thumbnail_url!!, stream())
|
||||
MangaImpl.setLastCoverFetch(manga.id!!, Date().time)
|
||||
SetAsCoverResult.Success
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user