HeanCMS: Add chapter title support (#4447)

This commit is contained in:
Wackery 2024-08-06 20:35:48 -07:00 committed by GitHub
parent e32bf4177c
commit 66615df76d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -2,7 +2,7 @@ plugins {
id("lib-multisrc") id("lib-multisrc")
} }
baseVersionCode = 26 baseVersionCode = 27
dependencies { dependencies {
api(project(":lib:i18n")) api(project(":lib:i18n"))

View File

@ -103,6 +103,7 @@ class HeanCmsChapterPayloadDto(
class HeanCmsChapterDto( class HeanCmsChapterDto(
private val id: Int, private val id: Int,
@SerialName("chapter_name") private val name: String, @SerialName("chapter_name") private val name: String,
@SerialName("chapter_title") private val title: String? = null,
@SerialName("chapter_slug") private val slug: String, @SerialName("chapter_slug") private val slug: String,
@SerialName("created_at") private val createdAt: String, @SerialName("created_at") private val createdAt: String,
val price: Int? = null, val price: Int? = null,
@ -114,6 +115,10 @@ class HeanCmsChapterDto(
): SChapter = SChapter.create().apply { ): SChapter = SChapter.create().apply {
name = this@HeanCmsChapterDto.name.trim() name = this@HeanCmsChapterDto.name.trim()
if (title != null) {
name += " - ${title.trim()}"
}
if (price != 0) { if (price != 0) {
name += " \uD83D\uDD12" name += " \uD83D\uDD12"
} }