From 05895aa4b887c71e971f038fb1de51c9568d0f4d Mon Sep 17 00:00:00 2001 From: gedoor Date: Thu, 6 May 2021 17:30:09 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E4=B8=8B=E8=BD=BD=E7=AB=A0=E8=8A=82?= =?UTF-8?q?=E5=8F=AF=E8=B0=83=E6=95=B4=E6=95=B0=E7=9B=AE?= 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 0eef72768..88e7e6fa3 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 @@ -140,8 +140,8 @@ object ReadBook { loadContent(durChapterIndex.plus(1), upContent, false) GlobalScope.launch(Dispatchers.IO) { val maxChapterIndex = - min(chapterSize, durChapterIndex + AppConfig.preDownloadNum) - for (i in 2 until maxChapterIndex) { + min(chapterSize - 1, durChapterIndex + AppConfig.preDownloadNum) + for (i in 2..maxChapterIndex) { delay(1000) download(durChapterIndex + i) } @@ -172,8 +172,8 @@ object ReadBook { loadContent(durChapterIndex.minus(1), upContent, false) GlobalScope.launch(Dispatchers.IO) { val maxChapterIndex = - min(chapterSize, durChapterIndex + AppConfig.preDownloadNum) - for (i in 2 until maxChapterIndex) { + min(chapterSize - 1, durChapterIndex + AppConfig.preDownloadNum) + for (i in 2..maxChapterIndex) { delay(1000) download(durChapterIndex - i) }