From 438c3ecabce3f46c9d63602bf08a20758cbc2255 Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 27 Jul 2021 22:42:17 +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/assets/updateLog.md | 4 ++-- .../java/io/legado/app/api/controller/BookController.kt | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 3e69b8efe..2ca6b2578 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -8,12 +8,12 @@ * 正文出现缺字漏字、内容缺失、排版错乱等情况,有可能是净化规则出现问题。先关闭替换净化并刷新,再观察是否正常。如果正常说明净化规则存在误杀,如果关闭后仍然出现相关问题,请点击源链接查看原文与正文是否相同,如果不同,再进行反馈。 * 漫画源看书显示乱码,**阅读与其他软件的源并不通用**,请导入阅读的支持的漫画源! -**2021/07/26** +**2021/07/27** 1. 修复bug 2. web使用api获取封面,不会再出现没有封面的情况 3. 阅读亮度手动调节分别记住白天和夜间模式 4. legado://import/auto?src={url}, 自动识别导入类型 -5. 一些优化并更新了一下web首页,感谢沚水 +5. 一些优化并更新了一下web首页,感谢沚水, 传书暂时还不好用 **2021/07/22** 1. 非关键规则添加try防止报错中断解析 diff --git a/app/src/main/java/io/legado/app/api/controller/BookController.kt b/app/src/main/java/io/legado/app/api/controller/BookController.kt index 34a77b9e2..509bd2e6e 100644 --- a/app/src/main/java/io/legado/app/api/controller/BookController.kt +++ b/app/src/main/java/io/legado/app/api/controller/BookController.kt @@ -193,14 +193,15 @@ object BookController { } } - private val bookFileFactory by lazy { - DiskFileItemFactory(0, LocalBook.cacheFolder) + private val uploader by lazy { + val dif = DiskFileItemFactory(0, LocalBook.cacheFolder) + NanoFileUpload(dif) } fun addLocalBook(session: NanoHTTPD.IHTTPSession, postData: String?): ReturnData { val returnData = ReturnData() try { - NanoFileUpload(bookFileFactory).parseRequest(session).forEach { + uploader.parseRequest(session).forEach { val path = FileUtils.getPath(LocalBook.cacheFolder, it.name) val nameAuthor = LocalBook.analyzeNameAuthor(it.name) val book = Book(