|
@@ -28,7 +28,7 @@ import uy.kohesive.injekt.api.get
|
|
|
class ChaptersPresenter(
|
|
|
val manga: Manga,
|
|
|
val source: Source,
|
|
|
- private val chapterCountRelay: BehaviorRelay<Int>,
|
|
|
+ private val chapterCountRelay: BehaviorRelay<Float>,
|
|
|
private val mangaFavoriteRelay: PublishRelay<Boolean>,
|
|
|
val preferences: PreferencesHelper = Injekt.get(),
|
|
|
private val db: DatabaseHelper = Injekt.get(),
|
|
@@ -92,7 +92,8 @@ class ChaptersPresenter(
|
|
|
observeDownloads()
|
|
|
|
|
|
// Emit the number of chapters to the info tab.
|
|
|
- chapterCountRelay.call(chapters.size)
|
|
|
+ chapterCountRelay.call(chapters.maxBy { it.chapter_number }?.chapter_number
|
|
|
+ ?: 0f)
|
|
|
}
|
|
|
.subscribe { chaptersRelay.call(it) })
|
|
|
}
|