mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-12 12:08:56 +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:
@@ -1,6 +1,7 @@
|
||||
package eu.kanade.tachiyomi.source.model
|
||||
|
||||
import tachiyomi.data.Mangas
|
||||
import tachiyomi.domain.manga.model.Manga
|
||||
|
||||
fun SManga.copyFrom(other: Mangas) {
|
||||
if (other.author != null) {
|
||||
@@ -29,3 +30,33 @@ fun SManga.copyFrom(other: Mangas) {
|
||||
initialized = other.initialized
|
||||
}
|
||||
}
|
||||
|
||||
fun Manga.copyFrom(other: Mangas): Manga {
|
||||
var manga = this
|
||||
if (other.author != null) {
|
||||
manga = manga.copy(author = other.author)
|
||||
}
|
||||
|
||||
if (other.artist != null) {
|
||||
manga = manga.copy(artist = other.artist)
|
||||
}
|
||||
|
||||
if (other.description != null) {
|
||||
manga = manga.copy(description = other.description)
|
||||
}
|
||||
|
||||
if (other.genre != null) {
|
||||
manga = manga.copy(genre = other.genre)
|
||||
}
|
||||
|
||||
if (other.thumbnail_url != null) {
|
||||
manga = manga.copy(thumbnailUrl = other.thumbnail_url)
|
||||
}
|
||||
|
||||
manga = manga.copy(status = other.status)
|
||||
|
||||
if (!initialized) {
|
||||
manga = manga.copy(initialized = other.initialized)
|
||||
}
|
||||
return manga
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user