[Komga] Display book aggregated data on Series screen (#5550)

* display Series summary from books if no summary exists for Series

closes gotson/komga#391

* display Series authors

closes #5481
This commit is contained in:
Gauthier 2021-01-25 20:27:53 +08:00 committed by GitHub
parent a5269a4536
commit b24fa5b9b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 3 deletions

View File

@ -1,3 +1,12 @@
## 1.2.19
Minimum Komga version required: `0.68.0`
### Features
* display Series authors
* display Series summary from books if no summary exists for Series
## 1.2.18
Minimum Komga version required: `0.63.2`

View File

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

View File

@ -216,7 +216,11 @@ open class Komga(suffix: String = "") : ConfigurableSource, HttpSource() {
else -> SManga.UNKNOWN
}
genre = (metadata.genres + metadata.tags).joinToString(", ")
description = metadata.summary
description = metadata.summary.ifBlank { booksMetadata.summary }
booksMetadata.authors.groupBy { it.role }.let {
author = it["writer"]?.map { it.name }?.distinct()?.joinToString()
artist = it["penciller"]?.map { it.name }?.distinct()?.joinToString()
}
}
private fun parseDate(date: String?): Long =

View File

@ -13,7 +13,8 @@ data class SeriesDto(
val lastModified: String?,
val fileLastModified: String,
val booksCount: Int,
val metadata: SeriesMetadataDto
val metadata: SeriesMetadataDto,
val booksMetadata: BookMetadataAggregationDto
)
data class SeriesMetadataDto(
@ -38,6 +39,16 @@ data class SeriesMetadataDto(
val tagsLock: Boolean
)
data class BookMetadataAggregationDto(
val authors: List<AuthorDto> = emptyList(),
val releaseDate: String?,
val summary: String,
val summaryNumber: String,
val created: String,
val lastModified: String
)
data class BookDto(
val id: String,
val seriesId: String,