浏览代码

[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
Platiplus 3 年之前
父节点
当前提交
828db19e02
共有 1 个文件被更改,包括 8 次插入3 次删除
  1. 8 3
      app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt

+ 8 - 3
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
         }
     }