mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-10 05:05:08 +01:00
Readded refresh button for single category libraries
Long pressing the library icon now updates the ui on library and recents
This commit is contained in:
parent
6e99caf458
commit
2e4af90b63
@ -241,14 +241,15 @@ class LibraryUpdateService(
|
||||
} else {
|
||||
val categoriesToUpdate =
|
||||
preferences.libraryUpdateCategories().getOrDefault().map(String::toInt)
|
||||
if (categoriesToUpdate.isNotEmpty()) {
|
||||
categoryIds.addAll(categoriesToUpdate)
|
||||
if (categoriesToUpdate.isNotEmpty())
|
||||
db.getLibraryMangas().executeAsBlocking()
|
||||
.filter { it.category in categoriesToUpdate }
|
||||
.distinctBy { it.id }
|
||||
else
|
||||
.filter { it.category in categoriesToUpdate }.distinctBy { it.id }
|
||||
} else {
|
||||
categoryIds.addAll(db.getCategories().executeAsBlocking().mapNotNull { it.id } + 0)
|
||||
db.getLibraryMangas().executeAsBlocking().distinctBy { it.id }
|
||||
}
|
||||
}
|
||||
if (target == Target.CHAPTERS && preferences.updateOnlyNonCompleted()) {
|
||||
listToUpdate = listToUpdate.filter { it.status != SManga.COMPLETED }
|
||||
}
|
||||
@ -339,12 +340,13 @@ class LibraryUpdateService(
|
||||
Timber.e(exception)
|
||||
stopSelf(startId)
|
||||
}
|
||||
if (target == Target.CHAPTERS) {
|
||||
job = GlobalScope.launch(handler) {
|
||||
job = if (target == Target.CHAPTERS) {
|
||||
listener?.onUpdateManga(LibraryManga())
|
||||
GlobalScope.launch(handler) {
|
||||
updateChaptersJob(mangaToAdd)
|
||||
}
|
||||
} else {
|
||||
job = GlobalScope.launch(handler) {
|
||||
GlobalScope.launch(handler) {
|
||||
updateTrackings(mangaToAdd)
|
||||
}
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ class LibraryHeaderItem(
|
||||
else -> {
|
||||
catProgress.gone()
|
||||
checkboxImage.gone()
|
||||
updateButton.visInvisIf(!(category.isFirst == true && category.isLast == true))
|
||||
updateButton.visInvisIf(category.id ?: 0 > -1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ class RecentsController(bundle: Bundle? = null) : BaseController(bundle),
|
||||
setPadding(dl_bottom_sheet.sheetBehavior?.isHideable == true)
|
||||
}
|
||||
|
||||
fun reEnableSwipe() {
|
||||
fun setRefreshing(refresh: Boolean) {
|
||||
swipe_refresh.isRefreshing = false
|
||||
}
|
||||
|
||||
|
@ -242,8 +242,13 @@ class RecentsPresenter(
|
||||
}
|
||||
|
||||
override fun onUpdateManga(manga: LibraryManga) {
|
||||
if (manga.id == null) scope.launch(Dispatchers.Main) { controller.reEnableSwipe() }
|
||||
else getRecents()
|
||||
if (manga.id == null && !LibraryUpdateService.isRunning()) {
|
||||
scope.launch(Dispatchers.Main) { controller.setRefreshing(false) }
|
||||
} else if (manga.id == null) {
|
||||
scope.launch(Dispatchers.Main) { controller.setRefreshing(true) }
|
||||
} else {
|
||||
getRecents()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user