diff --git a/app/src/main/java/io/legado/app/ui/book/audio/AudioPlayViewModel.kt b/app/src/main/java/io/legado/app/ui/book/audio/AudioPlayViewModel.kt index 6877bd036..086443409 100644 --- a/app/src/main/java/io/legado/app/ui/book/audio/AudioPlayViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/audio/AudioPlayViewModel.kt @@ -100,6 +100,7 @@ class AudioPlayViewModel(application: Application) : BaseViewModel(application) } else { loadChapterList(book1) { upChangeDurChapterIndex(book1, oldTocSize, it) } } + }.onFinally { postEvent(EventBus.SOURCE_CHANGED, book1.bookUrl) } } diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt index eef30dc4e..f7ba8ff00 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt @@ -169,6 +169,7 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { upChangeDurChapterIndex(newBook, oldTocSize, it) } } + }.onFinally { postEvent(EventBus.SOURCE_CHANGED, newBook.bookUrl) } } diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt index ebaa2f4bf..9395b8f1c 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt @@ -209,6 +209,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { upChangeDurChapterIndex(newBook, oldTocSize, it) } } + }.onFinally { postEvent(EventBus.SOURCE_CHANGED, newBook.bookUrl) } }