Use PageHandler for page requests

This commit is contained in:
Jobobby04
2021-06-05 15:24:02 -04:00
parent 143dfc6ad2
commit 38f2a93c0f
2 changed files with 27 additions and 26 deletions
@@ -38,10 +38,10 @@ class PageHandler(
"${MdUtil.atHomeUrl}/${MdUtil.getChapterId(chapter.url)}"
}
val (client, headers) = if (isLogged) {
client to MdUtil.getAuthHeaders(headers, preferences, mdList)
val headers = if (isLogged) {
MdUtil.getAuthHeaders(headers, preferences, mdList)
} else {
client to headers
headers
}
return client.newCall(pageListRequest(chapter))
@@ -53,6 +53,6 @@ class PageHandler(
}
private fun pageListRequest(chapter: SChapter): Request {
return GET("${MdUtil.chapterUrl}${MdUtil.getChapterId(chapter.url)}", headers, CacheControl.FORCE_NETWORK)
return GET(MdUtil.chapterUrl + MdUtil.getChapterId(chapter.url), headers, CacheControl.FORCE_NETWORK)
}
}