Ensure memo is correctly passed around when transforming classes

This commit is contained in:
AntsyLich
2026-06-16 19:05:52 +06:00
parent 5896d2c939
commit eb80ab410e
9 changed files with 16 additions and 4 deletions
@@ -13,6 +13,7 @@ fun Chapter.toSChapter(): SChapter {
it.date_upload = dateUpload
it.chapter_number = chapterNumber.toFloat()
it.scanlator = scanlator
it.memo = memo
}
}
@@ -23,6 +24,7 @@ fun Chapter.copyFromSChapter(sChapter: SChapter): Chapter {
dateUpload = sChapter.date_upload,
chapterNumber = sChapter.chapter_number.toDouble(),
scanlator = sChapter.scanlator?.ifBlank { null }?.trim(),
memo = sChapter.memo,
)
}
@@ -39,4 +41,5 @@ fun Chapter.toDbChapter(): DbChapter = ChapterImpl().also {
it.date_upload = dateUpload
it.chapter_number = chapterNumber.toFloat()
it.source_order = sourceOrder.toInt()
it.memo = memo
}
@@ -45,6 +45,7 @@ fun Manga.toSManga(): SManga = SManga.create().also {
it.status = status.toInt()
it.thumbnail_url = thumbnailUrl
it.initialized = initialized
it.memo = memo
}
fun Manga.copyFrom(other: SManga): Manga {
@@ -66,6 +67,7 @@ fun Manga.copyFrom(other: SManga): Manga {
status = other.status.toLong(),
updateStrategy = other.update_strategy,
initialized = other.initialized && initialized,
memo = other.memo,
)
}