[Komga] fix restoring backup & tags in filter panel (#6736)

* fix: set full url for manga so restoring a backup can work

* fix: only show series tags in the filter panel
This commit is contained in:
Gauthier 2021-04-28 20:43:55 +08:00 committed by GitHub
parent cca8d8299e
commit 3cd9bb0abb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 8 deletions

View File

@ -1,5 +1,15 @@
## 1.2.23
Minimum Komga version required: `0.87.4`
### Fix
* only show series tags in the filter panel
* set URL properly on series and read lists, so restoring from a backup can work properly
## 1.2.23
Minimum Komga version required: `0.75.0`
### Features

View File

@ -5,7 +5,7 @@ ext {
extName = 'Komga'
pkgNameSuffix = 'all.komga'
extClass = '.KomgaFactory'
extVersionCode = 23
extVersionCode = 24
libVersion = '1.2'
}

View File

@ -164,7 +164,7 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
processSeriesPage(response)
override fun mangaDetailsRequest(manga: SManga): Request =
GET(baseUrl + manga.url, headers)
GET(manga.url, headers)
override fun mangaDetailsParse(response: Response): SManga =
if (response.fromReadList()) {
@ -176,7 +176,7 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
}
override fun chapterListRequest(manga: SManga): Request =
GET("$baseUrl${manga.url}/books?unpaged=true&media_status=READY", headers)
GET("${manga.url}/books?unpaged=true&media_status=READY", headers)
override fun chapterListParse(response: Response): List<SChapter> {
val page = gson.fromJson<PageWrapperDto<BookDto>>(response.body()?.charStream()!!).content
@ -227,8 +227,8 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
private fun SeriesDto.toSManga(): SManga =
SManga.create().apply {
title = metadata.title
url = "/api/v1/series/$id"
thumbnail_url = "$baseUrl/api/v1/series/$id/thumbnail"
url = "$baseUrl/api/v1/series/$id"
thumbnail_url = "$url/thumbnail"
status = when (metadata.status) {
"ONGOING" -> SManga.ONGOING
"ENDED" -> SManga.COMPLETED
@ -245,8 +245,8 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
private fun ReadListDto.toSManga(): SManga =
SManga.create().apply {
title = name
url = "/api/v1/readlists/$id"
thumbnail_url = "$baseUrl/api/v1/readlists/$id/thumbnail"
url = "$baseUrl/api/v1/readlists/$id"
thumbnail_url = "$url/thumbnail"
status = SManga.UNKNOWN
}
@ -487,7 +487,7 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
)
Single.fromCallable {
client.newCall(GET("$baseUrl/api/v1/tags", headers)).execute()
client.newCall(GET("$baseUrl/api/v1/tags/series", headers)).execute()
}
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())