mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-15 13:37:29 +01:00
Migrate things to use newer data models (#9239)
* Remove old database models from Coil * Remove old database models from TrackInfoDialogHome * Remove old database models from Backup Manager
This commit is contained in:
@@ -2,6 +2,7 @@ package eu.kanade.domain.chapter.model
|
||||
|
||||
import eu.kanade.tachiyomi.data.database.models.ChapterImpl
|
||||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import tachiyomi.data.Chapters
|
||||
import tachiyomi.domain.chapter.model.Chapter
|
||||
import eu.kanade.tachiyomi.data.database.models.Chapter as DbChapter
|
||||
|
||||
@@ -26,6 +27,16 @@ fun Chapter.copyFromSChapter(sChapter: SChapter): Chapter {
|
||||
)
|
||||
}
|
||||
|
||||
fun Chapter.copyFrom(other: Chapters): Chapter {
|
||||
return copy(
|
||||
name = other.name,
|
||||
url = other.url,
|
||||
dateUpload = other.date_upload,
|
||||
chapterNumber = other.chapter_number,
|
||||
scanlator = other.scanlator?.ifBlank { null },
|
||||
)
|
||||
}
|
||||
|
||||
fun Chapter.toDbChapter(): DbChapter = ChapterImpl().also {
|
||||
it.id = id
|
||||
it.manga_id = mangaId
|
||||
|
||||
Reference in New Issue
Block a user