mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2025-01-26 22:45:30 +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 =
|
menu.findItem(R.id.action_mark_all_as_read).isVisible =
|
||||||
presenter.getNextUnreadChapter() != null && !presenter.isLockedFromSearch
|
presenter.getNextUnreadChapter() != null && !presenter.isLockedFromSearch
|
||||||
menu.findItem(R.id.action_mark_all_as_unread).isVisible =
|
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 =
|
menu.findItem(R.id.action_remove_downloads).isVisible =
|
||||||
presenter.hasDownloads() && !presenter.isLockedFromSearch &&
|
presenter.hasDownloads() && !presenter.isLockedFromSearch &&
|
||||||
manga?.source != LocalSource.ID
|
manga?.source != LocalSource.ID
|
||||||
menu.findItem(R.id.remove_non_bookmarked).isVisible =
|
menu.findItem(R.id.remove_non_bookmarked).isVisible =
|
||||||
presenter.hasBookmark() && !presenter.isLockedFromSearch
|
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 &&
|
menu.findItem(R.id.action_migrate).isVisible = !presenter.isLockedFromSearch &&
|
||||||
manga?.source != LocalSource.ID && presenter.manga.favorite
|
manga?.source != LocalSource.ID && presenter.manga.favorite
|
||||||
menu.findItem(R.id.action_migrate).title = view?.context?.getString(R.string.migrate_,
|
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 }
|
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 hasBookmark(): Boolean = chapters.any { it.bookmark }
|
||||||
fun hasDownloads(): Boolean = chapters.any { it.isDownloaded }
|
fun hasDownloads(): Boolean = chapters.any { it.isDownloaded }
|
||||||
|
|
||||||
|
@ -535,7 +535,11 @@ class ReaderPresenter(
|
|||||||
} else {
|
} else {
|
||||||
val thumbUrl = manga.thumbnail_url ?: throw Exception("Image url not found")
|
val thumbUrl = manga.thumbnail_url ?: throw Exception("Image url not found")
|
||||||
if (manga.favorite) {
|
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)
|
MangaImpl.setLastCoverFetch(manga.id!!, Date().time)
|
||||||
SetAsCoverResult.Success
|
SetAsCoverResult.Success
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user