From 1049a5a567bfc68bbc2661afaad71191abd88496 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sun, 7 Feb 2021 08:38:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E7=BB=84=E5=86=85?= =?UTF-8?q?=E4=B9=A6=E7=B1=8D=E6=95=B0=E7=9B=AE=E5=B0=91=E4=BA=8E=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=BA=BF=E7=A8=8B=E6=95=B0=E7=9B=AE=EF=BC=8C=E4=BC=9A?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E6=90=9C=E7=B4=A2=E7=BA=BF=E7=A8=8B=E6=95=B0?= =?UTF-8?q?=E7=9B=AE=E5=8F=98=E4=BD=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/ui/main/MainViewModel.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt b/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt index b60b51f40..b701c4f5d 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt @@ -66,8 +66,10 @@ class MainViewModel(application: Application) : BaseViewModel(application) { @Synchronized private fun updateToc() { + var update = false bookMap.forEach { bookEntry -> if (!updateList.contains(bookEntry.key)) { + update = true val book = bookEntry.value synchronized(this) { updateList.add(book.bookUrl) @@ -105,6 +107,9 @@ class MainViewModel(application: Application) : BaseViewModel(application) { return } } + if (!update) { + usePoolCount-- + } } private fun cacheBook(webBook: WebBook, book: Book) {