From 4406f91f7ec181d52c316fdcbbbd96a0a493c599 Mon Sep 17 00:00:00 2001 From: Gauthier Date: Fri, 14 Aug 2020 19:56:26 +0800 Subject: [PATCH] [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 --- src/all/komga/CHANGELOG.md | 8 ++++++++ src/all/komga/build.gradle | 2 +- .../eu/kanade/tachiyomi/extension/all/komga/Komga.kt | 11 ++++------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/all/komga/CHANGELOG.md b/src/all/komga/CHANGELOG.md index 350d2ba39..27eb5d5c9 100644 --- a/src/all/komga/CHANGELOG.md +++ b/src/all/komga/CHANGELOG.md @@ -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` diff --git a/src/all/komga/build.gradle b/src/all/komga/build.gradle index c0b4743ec..a08fff9df 100644 --- a/src/all/komga/build.gradle +++ b/src/all/komga/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Komga' pkgNameSuffix = 'all.komga' extClass = '.KomgaFactory' - extVersionCode = 13 + extVersionCode = 14 libVersion = '1.2' } diff --git a/src/all/komga/src/eu/kanade/tachiyomi/extension/all/komga/Komga.kt b/src/all/komga/src/eu/kanade/tachiyomi/extension/all/komga/Komga.kt index 3fcaececb..22726a717 100644 --- a/src/all/komga/src/eu/kanade/tachiyomi/extension/all/komga/Komga.kt +++ b/src/all/komga/src/eu/kanade/tachiyomi/extension/all/komga/Komga.kt @@ -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() }