Kavita: Bugfix/expected url scheme (#14322)

* pageListRequest now returns a correct url
This method was apparently not called in previous versions but it does now in the preview version (r5254) when downloading thus failing because was returning a wrong url.

* Changelog and bumped version
This commit is contained in:
ThePromidius 2022-11-20 20:33:05 +01:00 committed by GitHub
parent 7b7b6b4486
commit f2198c975e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,9 @@
## 1.3.8
### Fix
* Fixed `Expected URL scheme 'http' or 'https` when downloading
## 1.3.7
### Features
@ -6,6 +12,7 @@
* New Filter: Year release filter
### Fix
* Filters can now be used together with search
* Epub and pdfs no longer show in format filter (currently not supported)

View File

@ -6,7 +6,7 @@ ext {
extName = 'Kavita'
pkgNameSuffix = 'all.kavita'
extClass = '.KavitaFactory'
extVersionCode = 7
extVersionCode = 8
}
dependencies {

View File

@ -491,9 +491,8 @@ class Kavita(private val suffix: String = "") : ConfigurableSource, UnmeteredSou
* Fetches the "url" of each page from the chapter
* **/
override fun pageListRequest(chapter: SChapter): Request {
return GET("${chapter.url}/Reader/chapter-info")
return GET("$apiUrl/${chapter.url}", headersBuilder().build())
}
override fun fetchPageList(chapter: SChapter): Observable<List<Page>> {
val chapterId = chapter.url
val numPages = chapter.scanlator?.replace(" pages", "")?.toInt()
@ -850,7 +849,10 @@ class Kavita(private val suffix: String = "") : ConfigurableSource, UnmeteredSou
}
override fun headersBuilder(): Headers.Builder {
if (jwtToken.isEmpty()) throw LoginErrorException("401 Error\nOPDS address got modified or is incorrect")
if (jwtToken.isEmpty()) {
doLogin()
if (jwtToken.isEmpty()) throw LoginErrorException("Error: jwt token is empty.\nTry opening the extension first")
}
return Headers.Builder()
.add("User-Agent", "Tachiyomi Kavita v${AppInfo.getVersionName()}")
.add("Content-Type", "application/json")