use Book title instead of name (#2459)

use Book numberSort instead of number
This commit is contained in:
Gauthier 2020-03-20 17:47:21 +08:00 committed by GitHub
parent 0be01826cf
commit bc49af1d14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Komga'
pkgNameSuffix = 'all.komga'
extClass = '.Komga'
extVersionCode = 7
extVersionCode = 8
libVersion = '1.2'
}

View File

@ -99,8 +99,8 @@ open class Komga : ConfigurableSource, HttpSource() {
return page.content.map { book ->
SChapter.create().apply {
chapter_number = book.number
name = "${book.name} (${book.size})"
chapter_number = book.metadata.numberSort
name = "${book.metadata.title} (${book.size})"
url = "$baseUrl/api/v1/books/${book.id}"
date_upload = parseDate(book.lastModified)
}

View File

@ -34,7 +34,8 @@ data class BookDto(
val fileLastModified: String,
val sizeBytes: Long,
val size: String,
val media: MediaDto
val media: MediaDto,
val metadata: BookMetadataDto
)
data class MediaDto(
@ -48,3 +49,29 @@ data class PageDto(
val fileName: String,
val mediaType: String
)
data class BookMetadataDto(
val title: String,
val titleLock: Boolean,
val summary: String,
val summaryLock: Boolean,
val number: String,
val numberLock: Boolean,
val numberSort: Float,
val numberSortLock: Boolean,
val readingDirection: String,
val readingDirectionLock: Boolean,
val publisher: String,
val publisherLock: Boolean,
val ageRating: Int?,
val ageRatingLock: Boolean,
val releaseDate: String?,
val releaseDateLock: Boolean,
val authors: List<AuthorDto>,
val authorsLock: Boolean
)
data class AuthorDto(
val name: String,
val role: String
)