Iken: Adjust DTO to handle 'isNovel' & 'mangaSlug' (#5071)
* Iken: Bump versionCode * Iken: Adjust IkenDTO to handle isNovel, slug fields with ChapterPostDetails slug (courtesy of bapeey) --------- Co-authored-by: bapeey <90949336+bapeey@users.noreply.github.com>
This commit is contained in:
parent
8c426ce4fb
commit
2802de7b62
|
@ -2,4 +2,4 @@ plugins {
|
||||||
id("lib-multisrc")
|
id("lib-multisrc")
|
||||||
}
|
}
|
||||||
|
|
||||||
baseVersionCode = 3
|
baseVersionCode = 4
|
||||||
|
|
|
@ -83,8 +83,8 @@ class Post<T>(val post: T)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
class ChapterListResponse(
|
class ChapterListResponse(
|
||||||
val isNovel: Boolean,
|
val isNovel: Boolean = false,
|
||||||
val slug: String,
|
val slug: String? = null,
|
||||||
val chapters: List<Chapter>,
|
val chapters: List<Chapter>,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -96,11 +96,13 @@ class Chapter(
|
||||||
private val createdBy: Name,
|
private val createdBy: Name,
|
||||||
private val createdAt: String,
|
private val createdAt: String,
|
||||||
private val chapterStatus: String,
|
private val chapterStatus: String,
|
||||||
|
private val mangaPost: ChapterPostDetails,
|
||||||
) {
|
) {
|
||||||
fun isPublic() = chapterStatus == "PUBLIC"
|
fun isPublic() = chapterStatus == "PUBLIC"
|
||||||
|
|
||||||
fun toSChapter(mangaSlug: String) = SChapter.create().apply {
|
fun toSChapter(mangaSlug: String?) = SChapter.create().apply {
|
||||||
url = "/series/$mangaSlug/$slug#$id"
|
val seriesSlug = mangaSlug ?: mangaPost.slug
|
||||||
|
url = "/series/$seriesSlug/$slug#$id"
|
||||||
name = "Chapter $number"
|
name = "Chapter $number"
|
||||||
scanlator = createdBy.name
|
scanlator = createdBy.name
|
||||||
date_upload = try {
|
date_upload = try {
|
||||||
|
@ -111,4 +113,9 @@ class Chapter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
class ChapterPostDetails(
|
||||||
|
val slug: String,
|
||||||
|
)
|
||||||
|
|
||||||
private val dateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.ENGLISH)
|
private val dateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.ENGLISH)
|
||||||
|
|
Loading…
Reference in New Issue