From 34ceb900fd20d422cc6fc4361786a3ef9fe67626 Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 23 Nov 2020 22:37:20 +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/AudioPlayService.kt | 1 - app/src/main/java/io/legado/app/service/help/AudioPlay.kt | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/service/AudioPlayService.kt b/app/src/main/java/io/legado/app/service/AudioPlayService.kt index 64104ed87..1c6d215bd 100644 --- a/app/src/main/java/io/legado/app/service/AudioPlayService.kt +++ b/app/src/main/java/io/legado/app/service/AudioPlayService.kt @@ -274,7 +274,6 @@ class AudioPlayService : BaseService(), if (index == AudioPlay.durChapterIndex) { bookChapter = chapter subtitle = chapter.title - postEvent(EventBus.AUDIO_SUB_TITLE, subtitle) postEvent(EventBus.AUDIO_SIZE, chapter.end?.toInt() ?: 0) postEvent(EventBus.AUDIO_PROGRESS, position) } diff --git a/app/src/main/java/io/legado/app/service/help/AudioPlay.kt b/app/src/main/java/io/legado/app/service/help/AudioPlay.kt index ec120b491..35e6a4d1c 100644 --- a/app/src/main/java/io/legado/app/service/help/AudioPlay.kt +++ b/app/src/main/java/io/legado/app/service/help/AudioPlay.kt @@ -123,6 +123,9 @@ object AudioPlay { fun next(context: Context) { Coroutine.async { book?.let { book -> + if (book.durChapterIndex >= book.totalChapterNum) { + return@let + } pause(context) durChapterIndex++ durPageIndex = 0