[Komga] change chapter display to use title string instead of title number (#4121)

* change chapter display to use title string instead of title number

* version bump and changelog
This commit is contained in:
Gauthier 2020-08-14 19:56:26 +08:00 committed by GitHub
parent ee41b9d0f1
commit 4406f91f7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 8 deletions

View File

@ -1,3 +1,11 @@
## 1.2.14
Requires Komga `0.41.0`
### Features
* change chapter display name to use the display number instead of the sort number
## 1.2.13
Requires Komga `0.41.0`

View File

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

View File

@ -28,10 +28,6 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.HttpSource
import java.text.DecimalFormat
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
import okhttp3.Credentials
import okhttp3.Headers
import okhttp3.HttpUrl
@ -43,6 +39,9 @@ import rx.android.schedulers.AndroidSchedulers
import rx.schedulers.Schedulers
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
override fun popularMangaRequest(page: Int): Request =
@ -148,7 +147,7 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
return page.map { book ->
SChapter.create().apply {
chapter_number = book.metadata.numberSort
name = "${decimalFormat.format(book.metadata.numberSort)} - ${book.metadata.title} (${book.size})"
name = "${book.metadata.number} - ${book.metadata.title} (${book.size})"
url = "$baseUrl/api/v1/books/${book.id}"
date_upload = parseDate(book.lastModified)
}
@ -247,8 +246,6 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
override val lang = "en"
override val supportsLatest = true
private val decimalFormat: DecimalFormat by lazy { DecimalFormat("0.#") }
override val baseUrl by lazy { getPrefBaseUrl() }
private val username by lazy { getPrefUsername() }
private val password by lazy { getPrefPassword() }