From cf8f5e1811c39d49434e46ea227a737510f834d6 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 29 Jan 2020 10:17:15 +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 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 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 73e303483..a93a0606f 100644 --- a/app/src/main/java/io/legado/app/help/BookHelp.kt +++ b/app/src/main/java/io/legado/app/help/BookHelp.kt @@ -135,11 +135,15 @@ object BookHelp { ?.uri?.readText(App.INSTANCE) } } else { - return FileUtils.createFileIfNotExist( + val path = FileUtils.getPath( File(downloadPath), "${bookChapterName(bookChapter)}.nb", subDirs = *arrayOf(cacheFolderName, bookFolderName(book)) - ).readText() + ) + val file = File(path) + if (file.exists()) { + return file.readText() + } } return null }