mirror of
https://github.com/gotson/komga.git
synced 2025-12-26 18:36:08 +01:00
add booksCount to SeriesDto
add pagesCount to BookDto
This commit is contained in:
parent
ff30013395
commit
b687f7d161
1 changed files with 8 additions and 4 deletions
|
|
@ -290,14 +290,16 @@ data class SeriesDto(
|
|||
val name: String,
|
||||
val url: String,
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss")
|
||||
val lastModified: LocalDateTime?
|
||||
val lastModified: LocalDateTime?,
|
||||
val booksCount: Int
|
||||
)
|
||||
|
||||
fun Series.toDto() = SeriesDto(
|
||||
id = id,
|
||||
name = name,
|
||||
url = url.toString(),
|
||||
lastModified = lastModifiedDate?.toUTC()
|
||||
lastModified = lastModifiedDate?.toUTC(),
|
||||
booksCount = books.size
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -314,7 +316,8 @@ data class BookDto(
|
|||
|
||||
data class BookMetadataDto(
|
||||
val status: String,
|
||||
val mediaType: String
|
||||
val mediaType: String,
|
||||
val pagesCount: Int
|
||||
)
|
||||
|
||||
fun Book.toDto() =
|
||||
|
|
@ -327,7 +330,8 @@ fun Book.toDto() =
|
|||
size = fileSizeHumanReadable(),
|
||||
metadata = BookMetadataDto(
|
||||
status = metadata.status.toString(),
|
||||
mediaType = metadata.mediaType ?: ""
|
||||
mediaType = metadata.mediaType ?: "",
|
||||
pagesCount = metadata.pages.size
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue