From 828db19e025c52719afc4c0c9ef19c7765122aa5 Mon Sep 17 00:00:00 2001 From: Platiplus Date: Wed, 6 Oct 2021 23:03:07 -0300 Subject: [PATCH] [5753] - Add pending downloads count on Download queue (#6049) * Updating the download queue label to account for pending downloads even on paused state * changing separator --- .../eu/kanade/tachiyomi/ui/more/MoreController.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt index 6cc3e6020..742e43ff4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt @@ -170,10 +170,15 @@ class MoreController : } private fun updateDownloadQueueSummary(preference: Preference) { + var pendingDownloadExists = downloadQueueSize != 0 + var pauseMessage = resources?.getString(R.string.paused) + var numberOfPendingDownloads = resources?.getQuantityString(R.plurals.download_queue_summary, downloadQueueSize, downloadQueueSize) + preference.summary = when { - downloadQueueSize == 0 -> null - !isDownloading -> resources?.getString(R.string.paused) - else -> resources?.getQuantityString(R.plurals.download_queue_summary, downloadQueueSize, downloadQueueSize) + !pendingDownloadExists -> null + !isDownloading && !pendingDownloadExists -> pauseMessage + !isDownloading && pendingDownloadExists -> "$pauseMessage • $numberOfPendingDownloads" + else -> numberOfPendingDownloads } }