nhentai remove id check (#11721)

This commit is contained in:
Basara-Hatake 2022-05-03 22:53:46 +02:00 committed by GitHub
parent ea48dbc870
commit 3102383317
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 8 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'NHentai'
pkgNameSuffix = 'all.nhentai'
extClass = '.NHFactory'
extVersionCode = 31
extVersionCode = 32
isNsfw = true
}

View File

@ -115,7 +115,7 @@ open class NHentai(
.asObservableSuccess()
.map { response -> searchMangaByIdParse(response, id) }
}
query.isQueryIdNumbers() -> {
query.toIntOrNull() != null -> {
client.newCall(searchMangaByIdRequest(query))
.asObservableSuccess()
.map { response -> searchMangaByIdParse(response, query) }
@ -124,12 +124,6 @@ open class NHentai(
}
}
// The website redirects for any number <= 400000
private fun String.isQueryIdNumbers(): Boolean {
val int = this.toIntOrNull() ?: return false
return int <= 400000
}
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val fixedQuery = query.ifEmpty { "\"\"" }
val filterList = if (filters.isEmpty()) getFilterList() else filters