nhentai remove id check (#11721)
This commit is contained in:
parent
ea48dbc870
commit
3102383317
|
@ -5,7 +5,7 @@ ext {
|
||||||
extName = 'NHentai'
|
extName = 'NHentai'
|
||||||
pkgNameSuffix = 'all.nhentai'
|
pkgNameSuffix = 'all.nhentai'
|
||||||
extClass = '.NHFactory'
|
extClass = '.NHFactory'
|
||||||
extVersionCode = 31
|
extVersionCode = 32
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ open class NHentai(
|
||||||
.asObservableSuccess()
|
.asObservableSuccess()
|
||||||
.map { response -> searchMangaByIdParse(response, id) }
|
.map { response -> searchMangaByIdParse(response, id) }
|
||||||
}
|
}
|
||||||
query.isQueryIdNumbers() -> {
|
query.toIntOrNull() != null -> {
|
||||||
client.newCall(searchMangaByIdRequest(query))
|
client.newCall(searchMangaByIdRequest(query))
|
||||||
.asObservableSuccess()
|
.asObservableSuccess()
|
||||||
.map { response -> searchMangaByIdParse(response, query) }
|
.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 {
|
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
|
||||||
val fixedQuery = query.ifEmpty { "\"\"" }
|
val fixedQuery = query.ifEmpty { "\"\"" }
|
||||||
val filterList = if (filters.isEmpty()) getFilterList() else filters
|
val filterList = if (filters.isEmpty()) getFilterList() else filters
|
||||||
|
|
Loading…
Reference in New Issue