Add warning to Mangadex search (#2318)

Add warning to Mangadex search
This commit is contained in:
happywillow0 2020-02-29 22:08:59 -05:00 committed by GitHub
parent 89c54f9cb2
commit b1a291fae9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: MangaDex'
pkgNameSuffix = 'all.mangadex'
extClass = '.MangadexFactory'
extVersionCode = 82
extVersionCode = 83
libVersion = '1.2'
}

View File

@ -316,7 +316,18 @@ abstract class Mangadex(
}
}
} else {
return super.searchMangaParse(response)
val document = response.asJsoup()
if (document.select("#login_button").isNotEmpty()) throw Exception("Log in via WebView to enable search")
val mangas = document.select(searchMangaSelector()).map { element ->
searchMangaFromElement(element)
}
val hasNextPage = searchMangaNextPageSelector()?.let { selector ->
document.select(selector).first()
} != null
return MangasPage(mangas, hasNextPage)
}
}