From c3a9d76ce84ce3ddb1c6d9e6578b983692a530b9 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 17 Feb 2022 22:14:21 +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 | 16 ++++++---------- .../io/legado/app/model/localBook/LocalBook.kt | 1 + 2 files changed, 7 insertions(+), 10 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 a033cd06b..fb0b196bb 100644 --- a/app/src/main/java/io/legado/app/help/BookHelp.kt +++ b/app/src/main/java/io/legado/app/help/BookHelp.kt @@ -251,16 +251,12 @@ object BookHelp { * 删除章节内容 */ fun delContent(book: Book, bookChapter: BookChapter) { - if (book.isLocalTxt()) { - return - } else { - FileUtils.createFileIfNotExist( - downloadDir, - cacheFolderName, - book.getFolderName(), - bookChapter.getFileName() - ).delete() - } + FileUtils.createFileIfNotExist( + downloadDir, + cacheFolderName, + book.getFolderName(), + bookChapter.getFileName() + ).delete() } /** diff --git a/app/src/main/java/io/legado/app/model/localBook/LocalBook.kt b/app/src/main/java/io/legado/app/model/localBook/LocalBook.kt index adc586564..65bec08f5 100644 --- a/app/src/main/java/io/legado/app/model/localBook/LocalBook.kt +++ b/app/src/main/java/io/legado/app/model/localBook/LocalBook.kt @@ -162,6 +162,7 @@ object LocalBook { fun deleteBook(book: Book, deleteOriginal: Boolean) { kotlin.runCatching { + BookHelp.clearCache(book) if (deleteOriginal) { if (book.bookUrl.isContentScheme()) { val uri = Uri.parse(book.bookUrl)