From 0ab23d5f03b957ba36d44f4d647234eca246974e Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 31 Mar 2022 15:10:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/BookHelp.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/BookHelp.kt b/app/src/main/java/io/legado/app/help/BookHelp.kt index 69b63d9a1..63f2bc65f 100644 --- a/app/src/main/java/io/legado/app/help/BookHelp.kt +++ b/app/src/main/java/io/legado/app/help/BookHelp.kt @@ -46,9 +46,8 @@ object BookHelp { */ fun clearRemovedCache() { Coroutine.async { - val bookFolderNames = arrayListOf() - appDb.bookDao.all.forEach { - bookFolderNames.add(it.getFolderName()) + val bookFolderNames = appDb.bookDao.all.map { + it.getFolderName() } val file = downloadDir.getFile(cacheFolderName) file.listFiles()?.forEach { bookFile ->