Use SQLDelight in Backup/Restore (#7295)

* Use SQLDelight in Backup/Restore

* Use CoroutineWorker
This commit is contained in:
Andreas
2022-06-12 20:33:48 +02:00
committed by GitHub
parent 3c9f96d621
commit fd5da2de3a
20 changed files with 554 additions and 276 deletions

View File

@@ -1,5 +1,6 @@
package eu.kanade.tachiyomi.source.model
import data.Chapters
import tachiyomi.source.model.ChapterInfo
import java.io.Serializable
@@ -23,6 +24,14 @@ interface SChapter : Serializable {
scanlator = other.scanlator
}
fun copyFrom(other: Chapters) {
name = other.name
url = other.url
date_upload = other.date_upload
chapter_number = other.chapter_number
scanlator = other.scanlator
}
companion object {
fun create(): SChapter {
return SChapterImpl()

View File

@@ -1,5 +1,6 @@
package eu.kanade.tachiyomi.source.model
import data.Mangas
import tachiyomi.source.model.MangaInfo
import java.io.Serializable
@@ -51,6 +52,34 @@ interface SManga : Serializable {
}
}
fun copyFrom(other: Mangas) {
if (other.author != null) {
author = other.author
}
if (other.artist != null) {
artist = other.artist
}
if (other.description != null) {
description = other.description
}
if (other.genre != null) {
genre = other.genre.joinToString(separator = ", ")
}
if (other.thumbnail_url != null) {
thumbnail_url = other.thumbnail_url
}
status = other.status.toInt()
if (!initialized) {
initialized = other.initialized
}
}
companion object {
const val UNKNOWN = 0
const val ONGOING = 1