mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-19 03:39:18 +01:00
Fix download status not updated properly after starting batch download (#5348)
This commit is contained in:
parent
fb8aafb69f
commit
31d96c2bf0
@ -359,7 +359,7 @@ class MangaPresenter(
|
|||||||
observeDownloadsStatusSubscription?.let { remove(it) }
|
observeDownloadsStatusSubscription?.let { remove(it) }
|
||||||
observeDownloadsStatusSubscription = downloadManager.queue.getStatusObservable()
|
observeDownloadsStatusSubscription = downloadManager.queue.getStatusObservable()
|
||||||
.observeOn(Schedulers.io())
|
.observeOn(Schedulers.io())
|
||||||
.onBackpressureLatest()
|
.onBackpressureBuffer()
|
||||||
.filter { download -> download.manga.id == manga.id }
|
.filter { download -> download.manga.id == manga.id }
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribeLatestCache(
|
.subscribeLatestCache(
|
||||||
@ -375,7 +375,7 @@ class MangaPresenter(
|
|||||||
observeDownloadsPageSubscription?.let { remove(it) }
|
observeDownloadsPageSubscription?.let { remove(it) }
|
||||||
observeDownloadsPageSubscription = downloadManager.queue.getProgressObservable()
|
observeDownloadsPageSubscription = downloadManager.queue.getProgressObservable()
|
||||||
.observeOn(Schedulers.io())
|
.observeOn(Schedulers.io())
|
||||||
.onBackpressureLatest()
|
.onBackpressureBuffer()
|
||||||
.filter { download -> download.manga.id == manga.id }
|
.filter { download -> download.manga.id == manga.id }
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribeLatestCache(MangaController::onChapterDownloadUpdate) { _, error ->
|
.subscribeLatestCache(MangaController::onChapterDownloadUpdate) { _, error ->
|
||||||
|
@ -48,8 +48,6 @@ class ChapterDownloadView @JvmOverloads constructor(context: Context, attrs: Att
|
|||||||
state == Download.State.NOT_DOWNLOADED || state == Download.State.QUEUE
|
state == Download.State.NOT_DOWNLOADED || state == Download.State.QUEUE
|
||||||
if (shouldBeVisible) {
|
if (shouldBeVisible) {
|
||||||
hideAnimationBehavior = BaseProgressIndicator.HIDE_NONE
|
hideAnimationBehavior = BaseProgressIndicator.HIDE_NONE
|
||||||
show()
|
|
||||||
|
|
||||||
if (state == Download.State.NOT_DOWNLOADED || state == Download.State.QUEUE) {
|
if (state == Download.State.NOT_DOWNLOADED || state == Download.State.QUEUE) {
|
||||||
trackThickness = 2.dpToPx
|
trackThickness = 2.dpToPx
|
||||||
setIndicatorColor(context.getThemeColor(android.R.attr.textColorHint))
|
setIndicatorColor(context.getThemeColor(android.R.attr.textColorHint))
|
||||||
@ -72,6 +70,7 @@ class ChapterDownloadView @JvmOverloads constructor(context: Context, attrs: Att
|
|||||||
setIndicatorColor(context.getThemeColor(android.R.attr.textColorPrimary))
|
setIndicatorColor(context.getThemeColor(android.R.attr.textColorPrimary))
|
||||||
setProgressCompat(progress, true)
|
setProgressCompat(progress, true)
|
||||||
}
|
}
|
||||||
|
show()
|
||||||
} else {
|
} else {
|
||||||
hideAnimationBehavior = BaseProgressIndicator.HIDE_OUTWARD
|
hideAnimationBehavior = BaseProgressIndicator.HIDE_OUTWARD
|
||||||
hide()
|
hide()
|
||||||
|
@ -41,7 +41,7 @@ class UpdatesPresenter(
|
|||||||
|
|
||||||
downloadManager.queue.getStatusObservable()
|
downloadManager.queue.getStatusObservable()
|
||||||
.observeOn(Schedulers.io())
|
.observeOn(Schedulers.io())
|
||||||
.onBackpressureLatest()
|
.onBackpressureBuffer()
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribeLatestCache(
|
.subscribeLatestCache(
|
||||||
{ view, it ->
|
{ view, it ->
|
||||||
@ -55,7 +55,7 @@ class UpdatesPresenter(
|
|||||||
|
|
||||||
downloadManager.queue.getProgressObservable()
|
downloadManager.queue.getProgressObservable()
|
||||||
.observeOn(Schedulers.io())
|
.observeOn(Schedulers.io())
|
||||||
.onBackpressureLatest()
|
.onBackpressureBuffer()
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribeLatestCache(UpdatesController::onChapterDownloadUpdate) { _, error ->
|
.subscribeLatestCache(UpdatesController::onChapterDownloadUpdate) { _, error ->
|
||||||
Timber.e(error)
|
Timber.e(error)
|
||||||
|
Loading…
Reference in New Issue
Block a user