From ec9e19f274cc82a469fb72e9dd2b55e9ce1e522b Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 21 Jul 2021 22:07:36 +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/service/help/ReadBook.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/service/help/ReadBook.kt b/app/src/main/java/io/legado/app/service/help/ReadBook.kt index b0202682b..316151632 100644 --- a/app/src/main/java/io/legado/app/service/help/ReadBook.kt +++ b/app/src/main/java/io/legado/app/service/help/ReadBook.kt @@ -27,7 +27,6 @@ import kotlin.math.min object ReadBook { var titleDate = MutableLiveData() var book: Book? = null - var contentProcessor: ContentProcessor? = null var inBookshelf = false var chapterSize = 0 var durChapterIndex = 0 @@ -46,7 +45,6 @@ object ReadBook { fun resetData(book: Book) { this.book = book - contentProcessor = ContentProcessor.get(book.name, book.origin) readRecord.bookName = book.name readRecord.readTime = appDb.readRecordDao.getReadTime(book.name) ?: 0 durChapterIndex = book.durChapterIndex @@ -414,9 +412,10 @@ object ReadBook { 2 -> ChineseUtils.s2t(chapter.title) else -> chapter.title } - val contents = contentProcessor!!.getContent(book, chapter.title, content) - val textChapter = - ChapterProvider.getTextChapter(book, chapter, contents, chapterSize) + val contents = ContentProcessor.get(book.name, book.origin) + .getContent(book, chapter.title, content) + val textChapter = ChapterProvider + .getTextChapter(book, chapter, contents, chapterSize) val offset = chapter.index - durChapterIndex if (upContent) callBack?.upContent(offset, resetPageOffset)