Fix for when a request requests page 1 (#14323)
* Fix for #14276 * increase versionCode * fixed issue with requests going to page 1 Co-authored-by: Alec <alec.l@digipen.edu>
This commit is contained in:
parent
f2198c975e
commit
1cefaf0867
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'E-Hentai'
|
||||
pkgNameSuffix = 'all.ehentai'
|
||||
extClass = '.EHFactory'
|
||||
extVersionCode = 18
|
||||
extVersionCode = 19
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -171,6 +171,7 @@ abstract class EHentai(
|
|||
if (uri.toString().contains("f_spf") || uri.toString().contains("f_spt")) {
|
||||
if (page > 1) uri.appendQueryParameter("from", lastMangaId)
|
||||
}
|
||||
|
||||
return exGet(uri.toString(), page)
|
||||
}
|
||||
|
||||
|
@ -181,8 +182,10 @@ abstract class EHentai(
|
|||
override fun latestUpdatesParse(response: Response) = genericMangaParse(response)
|
||||
|
||||
private fun exGet(url: String, page: Int? = null, additionalHeaders: Headers? = null, cache: Boolean = true): Request {
|
||||
//pages no longer exist, if app attempts to go to the first page after a request, do not include the page append
|
||||
val pageIndex = if (page == 1) null else page
|
||||
return GET(
|
||||
page?.let {
|
||||
pageIndex?.let {
|
||||
addParam(url, "next", lastMangaId)
|
||||
} ?: url,
|
||||
additionalHeaders?.let { header ->
|
||||
|
@ -194,6 +197,7 @@ abstract class EHentai(
|
|||
}
|
||||
headers.build()
|
||||
} ?: headers
|
||||
|
||||
).let {
|
||||
if (!cache) {
|
||||
it.newBuilder().cacheControl(CacheControl.FORCE_NETWORK).build()
|
||||
|
|
Loading…
Reference in New Issue