From 2aeb7a421927d56e958a9c3e0262861cbd50fda2 Mon Sep 17 00:00:00 2001 From: ag2s20150909 Date: Fri, 2 Jul 2021 15:06:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0Umd=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/model/localBook/UmdFile.kt | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/localBook/UmdFile.kt b/app/src/main/java/io/legado/app/model/localBook/UmdFile.kt index 394072085..de6c1586f 100644 --- a/app/src/main/java/io/legado/app/model/localBook/UmdFile.kt +++ b/app/src/main/java/io/legado/app/model/localBook/UmdFile.kt @@ -18,27 +18,27 @@ import java.util.ArrayList class UmdFile(var book: Book) { companion object { - private var eFile: UmdFile? = null + private var uFile: UmdFile? = null @Synchronized - private fun getEFile(book: Book): UmdFile { + private fun getUFile(book: Book): UmdFile { - if (eFile == null || eFile?.book?.bookUrl != book.bookUrl) { - eFile = UmdFile(book) - return eFile!! + if (uFile == null || uFile?.book?.bookUrl != book.bookUrl) { + uFile = UmdFile(book) + return uFile!! } - eFile?.book = book - return eFile!! + uFile?.book = book + return uFile!! } @Synchronized fun getChapterList(book: Book): ArrayList { - return getEFile(book).getChapterList() + return getUFile(book).getChapterList() } @Synchronized fun getContent(book: Book, chapter: BookChapter): String? { - return getEFile(book).getContent(chapter) + return getUFile(book).getContent(chapter) } @Synchronized @@ -46,13 +46,13 @@ class UmdFile(var book: Book) { book: Book, href: String ): InputStream? { - return getEFile(book).getImage(href) + return getUFile(book).getImage(href) } @Synchronized fun upBookInfo(book: Book) { - return getEFile(book).upBookInfo() + return getUFile(book).upBookInfo() } } @@ -100,7 +100,7 @@ class UmdFile(var book: Book) { private fun upBookInfo() { if(umdBook==null){ - eFile = null + uFile = null book.intro = "书籍导入异常" }else{ val hd= umdBook!!.header @@ -115,7 +115,7 @@ class UmdFile(var book: Book) { private fun getChapterList(): ArrayList { val chapterList = ArrayList() - umdBook?.chapters?.titles?.forEachIndexed { index, bytes -> + umdBook?.chapters?.titles?.forEachIndexed { index, _ -> val title = umdBook!!.chapters.getTitle(index) val chapter = BookChapter() chapter.title=title;