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 ->