Fix actions not applying to filtered chapters
This commit is contained in:
parent
34ef3f2b9f
commit
3ba6aeb8d5
@ -142,19 +142,22 @@ class MangaAllInOnePresenter(
|
|||||||
}
|
}
|
||||||
// EXH <--
|
// EXH <--
|
||||||
|
|
||||||
this.chapters = applyChapterFilters(chapters)
|
this.chapters = chapters
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private suspend fun getUpdatedChapters(): List<MangaAllInOneChapterItem> = applyChapterFilters(chapters)
|
||||||
|
|
||||||
private fun updateChaptersView(updateInfo: Boolean = false) {
|
private fun updateChaptersView(updateInfo: Boolean = false) {
|
||||||
scope.launch(Dispatchers.IO) {
|
scope.launch(Dispatchers.IO) {
|
||||||
updateChapters()
|
updateChapters()
|
||||||
|
val chapterList = getUpdatedChapters()
|
||||||
if (updateInfo) {
|
if (updateInfo) {
|
||||||
updateChapterInfo()
|
updateChapterInfo()
|
||||||
}
|
}
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
Observable.just(manga)
|
Observable.just(manga)
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribeLatestCache({ view, manga -> view.onNextManga(manga, source, chapters, lastUpdateDate, chapterCount) })
|
.subscribeLatestCache({ view, manga -> view.onNextManga(manga, source, chapterList, lastUpdateDate, chapterCount) })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -172,10 +175,12 @@ class MangaAllInOnePresenter(
|
|||||||
private fun updateManga(updateInfo: Boolean = true) {
|
private fun updateManga(updateInfo: Boolean = true) {
|
||||||
scope.launch(Dispatchers.IO) {
|
scope.launch(Dispatchers.IO) {
|
||||||
var manga2: Manga? = null
|
var manga2: Manga? = null
|
||||||
|
var chapterList = getUpdatedChapters()
|
||||||
if (updateInfo) {
|
if (updateInfo) {
|
||||||
manga2 = db.getManga(manga.url, manga.source).await()
|
manga2 = db.getManga(manga.url, manga.source).await()
|
||||||
updateChapters()
|
updateChapters()
|
||||||
updateChapterInfo()
|
updateChapterInfo()
|
||||||
|
chapterList = getUpdatedChapters()
|
||||||
}
|
}
|
||||||
|
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
@ -184,7 +189,7 @@ class MangaAllInOnePresenter(
|
|||||||
} else {
|
} else {
|
||||||
Observable.just(manga)
|
Observable.just(manga)
|
||||||
}.observeOn(AndroidSchedulers.mainThread())
|
}.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribeLatestCache({ view, manga -> view.onNextManga(manga, source, chapters, lastUpdateDate, chapterCount) })
|
.subscribeLatestCache({ view, manga -> view.onNextManga(manga, source, chapterList, lastUpdateDate, chapterCount) })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user