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:
Andreas
2023-03-19 18:11:58 +01:00
committed by GitHub
parent c955ac6a66
commit dfdb688b43
16 changed files with 231 additions and 348 deletions

View File

@@ -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
}