Skip to content

Commit

Permalink
fix(id/oploverz): unhandled error during search
Browse files Browse the repository at this point in the history
  • Loading branch information
dannycreations committed Oct 31, 2023
1 parent 6d2e9ff commit 49b762f
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,15 @@ class Oploverz : ConfigurableAnimeSource, AnimeHttpSource() {
}

private fun hasNextPage(document: Document): Boolean {
val pagination = document.selectFirst("div.pagination")!!
val totalPage =
pagination.selectFirst("span:nth-child(1)")!!.text().split(" ").last().toInt()
val currentPage = pagination.selectFirst("span.page-numbers.current")!!.text().toInt()
return currentPage > totalPage
try {
val pagination = document.selectFirst("div.pagination")!!
val totalPage =
pagination.selectFirst("span:nth-child(1)")!!.text().split(" ").last().toInt()
val currentPage = pagination.selectFirst("span.page-numbers.current")!!.text().toInt()
return currentPage > totalPage
} catch (_: Exception) {
return false
}
}

private fun parseStatus(status: String?): Int {
Expand Down

0 comments on commit 49b762f

Please sign in to comment.