mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-25 03:33:24 +01:00
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
7ce0bb0fee
commit
f7f3b0e30c
@ -2,4 +2,4 @@ plugins {
|
||||
id("lib-multisrc")
|
||||
}
|
||||
|
||||
baseVersionCode = 3
|
||||
baseVersionCode = 4
|
||||
|
@ -83,8 +83,8 @@ class Post<T>(val post: T)
|
||||
|
||||
@Serializable
|
||||
class ChapterListResponse(
|
||||
val isNovel: Boolean,
|
||||
val slug: String,
|
||||
val isNovel: Boolean = false,
|
||||
val slug: String? = null,
|
||||
val chapters: List<Chapter>,
|
||||
)
|
||||
|
||||
@ -96,11 +96,13 @@ class Chapter(
|
||||
private val createdBy: Name,
|
||||
private val createdAt: String,
|
||||
private val chapterStatus: String,
|
||||
private val mangaPost: ChapterPostDetails,
|
||||
) {
|
||||
fun isPublic() = chapterStatus == "PUBLIC"
|
||||
|
||||
fun toSChapter(mangaSlug: String) = SChapter.create().apply {
|
||||
url = "/series/$mangaSlug/$slug#$id"
|
||||
fun toSChapter(mangaSlug: String?) = SChapter.create().apply {
|
||||
val seriesSlug = mangaSlug ?: mangaPost.slug
|
||||
url = "/series/$seriesSlug/$slug#$id"
|
||||
name = "Chapter $number"
|
||||
scanlator = createdBy.name
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user