feat(komga): display book translators as chapter scanlator (#10099)

This commit is contained in:
Gauthier 2021-12-14 18:52:52 +08:00 committed by GitHub
parent b210902b2c
commit d718c8a10f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,11 @@
## 1.2.35
Minimum Komga version required: `0.113.0`
### Features
* Display the Translators of a book in the scanlator chapter field
## 1.2.34
Minimum Komga version required: `0.113.0`

View File

@ -6,7 +6,7 @@ ext {
extName = 'Komga'
pkgNameSuffix = 'all.komga'
extClass = '.KomgaFactory'
extVersionCode = 34
extVersionCode = 35
}
dependencies {

View File

@ -215,6 +215,7 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
chapter_number = if (!response.fromReadList()) book.metadata.numberSort else index + 1F
name = "${if (!response.fromReadList()) "${book.metadata.number} - " else ""}${book.metadata.title} (${book.size})"
url = "$baseUrl/api/v1/books/${book.id}"
scanlator = book.metadata.authors.groupBy({ it.role }, { it.name })["translator"]?.joinToString()
date_upload = book.metadata.releaseDate?.let { parseDate(it) }
?: parseDateTime(book.fileLastModified)
}