mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-19 03:59:19 +01:00
Fix exception thrown when Batoto search is empty
This commit is contained in:
parent
e16bf0698e
commit
f7bb356abd
@ -73,7 +73,7 @@ class Batoto(context: Context, override val id: Int) : ParsedOnlineSource(contex
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun popularMangaSelector() = "tr:not([id]):not([class])"
|
override fun popularMangaSelector() = "tr:has(a)"
|
||||||
|
|
||||||
override fun popularMangaFromElement(element: Element, manga: Manga) {
|
override fun popularMangaFromElement(element: Element, manga: Manga) {
|
||||||
element.select("a[href^=http://bato.to]").first().let {
|
element.select("a[href^=http://bato.to]").first().let {
|
||||||
|
@ -36,9 +36,11 @@ class CatalogueAdapter(val fragment: CatalogueFragment) : FlexibleAdapter<Catalo
|
|||||||
* @param list the list to add.
|
* @param list the list to add.
|
||||||
*/
|
*/
|
||||||
fun addItems(list: List<Manga>) {
|
fun addItems(list: List<Manga>) {
|
||||||
val sizeBeforeAdding = mItems.size
|
if (list.isNotEmpty()) {
|
||||||
mItems.addAll(list)
|
val sizeBeforeAdding = mItems.size
|
||||||
notifyItemRangeInserted(sizeBeforeAdding, list.size)
|
mItems.addAll(list)
|
||||||
|
notifyItemRangeInserted(sizeBeforeAdding, list.size)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -229,7 +229,6 @@ class CataloguePresenter : BasePresenter<CatalogueFragment>() {
|
|||||||
source.fetchSearchManga(nextMangasPage, query)
|
source.fetchSearchManga(nextMangasPage, query)
|
||||||
|
|
||||||
return observable.subscribeOn(Schedulers.io())
|
return observable.subscribeOn(Schedulers.io())
|
||||||
.doOnNext { if (it.mangas.isEmpty()) throw Exception("Empty page") }
|
|
||||||
.doOnNext { lastMangasPage = it }
|
.doOnNext { lastMangasPage = it }
|
||||||
.flatMap { Observable.from(it.mangas) }
|
.flatMap { Observable.from(it.mangas) }
|
||||||
.map { networkToLocalManga(it) }
|
.map { networkToLocalManga(it) }
|
||||||
|
Loading…
Reference in New Issue
Block a user