|
|
|
@ -1,6 +1,7 @@
|
|
|
|
package org.koitharu.kotatsu.parsers.model
|
|
|
|
package org.koitharu.kotatsu.parsers.model
|
|
|
|
|
|
|
|
|
|
|
|
import org.koitharu.kotatsu.parsers.util.formatSimple
|
|
|
|
import org.koitharu.kotatsu.parsers.util.formatSimple
|
|
|
|
|
|
|
|
import org.koitharu.kotatsu.parsers.util.ifNullOrEmpty
|
|
|
|
|
|
|
|
|
|
|
|
public data class MangaChapter(
|
|
|
|
public data class MangaChapter(
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@ -8,9 +9,10 @@ public data class MangaChapter(
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@JvmField public val id: Long,
|
|
|
|
@JvmField public val id: Long,
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* User-readable name of chapter
|
|
|
|
* User-readable name of chapter if provided by parser or null instead
|
|
|
|
|
|
|
|
* Do not pass manga title or chapter number here
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@JvmField public val name: String,
|
|
|
|
@JvmField public val title: String?,
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Chapter number starting from 1, 0 if unknown
|
|
|
|
* Chapter number starting from 1, 0 if unknown
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ -40,6 +42,15 @@ public data class MangaChapter(
|
|
|
|
@JvmField public val source: MangaSource,
|
|
|
|
@JvmField public val source: MangaSource,
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Deprecated("Use title instead", ReplaceWith("title"))
|
|
|
|
|
|
|
|
val name: String
|
|
|
|
|
|
|
|
get() = title.ifNullOrEmpty {
|
|
|
|
|
|
|
|
buildString {
|
|
|
|
|
|
|
|
if (volume > 0) append("Vol ").append(volume).append(' ')
|
|
|
|
|
|
|
|
if (number > 0) append("Chapter ").append(number) else append("Unnamed")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public fun numberString(): String? = if (number > 0f) {
|
|
|
|
public fun numberString(): String? = if (number > 0f) {
|
|
|
|
number.formatSimple()
|
|
|
|
number.formatSimple()
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|