[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

(cherry picked from commit 828db19e025c52719afc4c0c9ef19c7765122aa5)
This commit is contained in:
Platiplus 2021-10-06 23:03:07 -03:00 committed by Jobobby04
parent 4380283ad1
commit 22a1544427

View File

@ -205,10 +205,15 @@ class MoreController :
} }
private fun updateDownloadQueueSummary(preference: Preference) { 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 { preference.summary = when {
downloadQueueSize == 0 -> null !pendingDownloadExists -> null
!isDownloading -> resources?.getString(R.string.paused) !isDownloading && !pendingDownloadExists -> pauseMessage
else -> resources?.getQuantityString(R.plurals.download_queue_summary, downloadQueueSize, downloadQueueSize) !isDownloading && pendingDownloadExists -> "$pauseMessage$numberOfPendingDownloads"
else -> numberOfPendingDownloads
} }
} }