diff --git a/app/build.gradle b/app/build.gradle index 17e421829..8150e2dec 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -169,7 +169,7 @@ dependencies { implementation("androidx.lifecycle:lifecycle-common-java8:$lifecycle_version") //room - def room_version = '2.3.0' + def room_version = '2.4.0-beta02' implementation("androidx.room:room-runtime:$room_version") implementation("androidx.room:room-ktx:$room_version") kapt("androidx.room:room-compiler:$room_version") diff --git a/app/src/main/java/io/legado/app/data/entities/Book.kt b/app/src/main/java/io/legado/app/data/entities/Book.kt index 79fc9dbe2..5b61a6cc7 100644 --- a/app/src/main/java/io/legado/app/data/entities/Book.kt +++ b/app/src/main/java/io/legado/app/data/entities/Book.kt @@ -56,9 +56,6 @@ data class Book( var readConfig: ReadConfig? = null ) : Parcelable, BaseBook { - @Ignore - constructor() : this(bookUrl = "") - fun isLocalBook(): Boolean { return origin == BookType.local } diff --git a/app/src/main/java/io/legado/app/data/entities/BookChapter.kt b/app/src/main/java/io/legado/app/data/entities/BookChapter.kt index 48f4fc3bf..39b8ea6b0 100644 --- a/app/src/main/java/io/legado/app/data/entities/BookChapter.kt +++ b/app/src/main/java/io/legado/app/data/entities/BookChapter.kt @@ -47,9 +47,6 @@ data class BookChapter( var variable: String? = null //变量 ) : Parcelable, RuleDataInterface { - @Ignore - constructor() : this(url = "", bookUrl = "") - @delegate:Transient @delegate:Ignore @IgnoredOnParcel diff --git a/app/src/main/java/io/legado/app/data/entities/BookGroup.kt b/app/src/main/java/io/legado/app/data/entities/BookGroup.kt index 78cc44cce..f19f5f05c 100644 --- a/app/src/main/java/io/legado/app/data/entities/BookGroup.kt +++ b/app/src/main/java/io/legado/app/data/entities/BookGroup.kt @@ -3,7 +3,6 @@ package io.legado.app.data.entities import android.content.Context import android.os.Parcelable import androidx.room.Entity -import androidx.room.Ignore import androidx.room.PrimaryKey import io.legado.app.R import io.legado.app.constant.AppConst @@ -20,9 +19,6 @@ data class BookGroup( var show: Boolean = true ) : Parcelable { - @Ignore - constructor() : this(groupName = "") - fun getManageName(context: Context): String { return when (groupId) { AppConst.bookGroupAllId -> "$groupName(${context.getString(R.string.all)})" diff --git a/app/src/main/java/io/legado/app/data/entities/BookSource.kt b/app/src/main/java/io/legado/app/data/entities/BookSource.kt index bcc222ba5..12cf72bb9 100644 --- a/app/src/main/java/io/legado/app/data/entities/BookSource.kt +++ b/app/src/main/java/io/legado/app/data/entities/BookSource.kt @@ -46,9 +46,6 @@ data class BookSource( var ruleContent: ContentRule? = null // 正文页规则 ) : Parcelable, BaseSource { - @Ignore - constructor() : this(bookSourceUrl = "") - override fun getTag(): String { return bookSourceName } diff --git a/app/src/main/java/io/legado/app/data/entities/Bookmark.kt b/app/src/main/java/io/legado/app/data/entities/Bookmark.kt index e844fb4b8..109397042 100644 --- a/app/src/main/java/io/legado/app/data/entities/Bookmark.kt +++ b/app/src/main/java/io/legado/app/data/entities/Bookmark.kt @@ -2,7 +2,6 @@ package io.legado.app.data.entities import android.os.Parcelable import androidx.room.Entity -import androidx.room.Ignore import androidx.room.Index import androidx.room.PrimaryKey import kotlinx.parcelize.Parcelize @@ -22,9 +21,4 @@ data class Bookmark( var chapterName: String = "", var bookText: String = "", var content: String = "" -) : Parcelable { - - @Ignore - constructor() : this(time = System.currentTimeMillis()) - -} \ No newline at end of file +) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/data/entities/Cache.kt b/app/src/main/java/io/legado/app/data/entities/Cache.kt index 39c0bd808..f9687dea7 100644 --- a/app/src/main/java/io/legado/app/data/entities/Cache.kt +++ b/app/src/main/java/io/legado/app/data/entities/Cache.kt @@ -1,7 +1,6 @@ package io.legado.app.data.entities import androidx.room.Entity -import androidx.room.Ignore import androidx.room.Index import androidx.room.PrimaryKey @@ -11,9 +10,4 @@ data class Cache( val key: String = "", var value: String? = null, var deadline: Long = 0L -) { - - @Ignore - constructor() : this(key = "") - -} \ No newline at end of file +) \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/data/entities/Cookie.kt b/app/src/main/java/io/legado/app/data/entities/Cookie.kt index 193fb643c..8e12febf4 100644 --- a/app/src/main/java/io/legado/app/data/entities/Cookie.kt +++ b/app/src/main/java/io/legado/app/data/entities/Cookie.kt @@ -1,7 +1,6 @@ package io.legado.app.data.entities import androidx.room.Entity -import androidx.room.Ignore import androidx.room.Index import androidx.room.PrimaryKey @@ -10,9 +9,4 @@ data class Cookie( @PrimaryKey var url: String = "", var cookie: String = "" -) { - - @Ignore - constructor() : this(url = "") - -} \ No newline at end of file +) \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/data/entities/HttpTTS.kt b/app/src/main/java/io/legado/app/data/entities/HttpTTS.kt index 0fff5786e..3b1db4512 100644 --- a/app/src/main/java/io/legado/app/data/entities/HttpTTS.kt +++ b/app/src/main/java/io/legado/app/data/entities/HttpTTS.kt @@ -1,7 +1,6 @@ package io.legado.app.data.entities import androidx.room.Entity -import androidx.room.Ignore import androidx.room.PrimaryKey import com.jayway.jsonpath.DocumentContext import io.legado.app.utils.GSON @@ -26,9 +25,6 @@ data class HttpTTS( var loginCheckJs: String? = null, ) : BaseSource { - @Ignore - constructor() : this(id = System.currentTimeMillis()) - override fun getTag(): String { return name } diff --git a/app/src/main/java/io/legado/app/data/entities/ReadRecord.kt b/app/src/main/java/io/legado/app/data/entities/ReadRecord.kt index b12246c62..2b2b5caf4 100644 --- a/app/src/main/java/io/legado/app/data/entities/ReadRecord.kt +++ b/app/src/main/java/io/legado/app/data/entities/ReadRecord.kt @@ -1,16 +1,10 @@ package io.legado.app.data.entities import androidx.room.Entity -import androidx.room.Ignore @Entity(tableName = "readRecord", primaryKeys = ["deviceId", "bookName"]) data class ReadRecord( var deviceId: String = "", var bookName: String = "", var readTime: Long = 0L -) { - - @Ignore - constructor() : this(deviceId = "") - -} \ No newline at end of file +) \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/data/entities/ReadRecordShow.kt b/app/src/main/java/io/legado/app/data/entities/ReadRecordShow.kt index 0ede36a84..79795b0d9 100644 --- a/app/src/main/java/io/legado/app/data/entities/ReadRecordShow.kt +++ b/app/src/main/java/io/legado/app/data/entities/ReadRecordShow.kt @@ -1,13 +1,6 @@ package io.legado.app.data.entities -import androidx.room.Ignore - data class ReadRecordShow( var bookName: String = "", var readTime: Long = 0L -) { - - @Ignore - constructor() : this("") - -} \ No newline at end of file +) \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/data/entities/ReplaceRule.kt b/app/src/main/java/io/legado/app/data/entities/ReplaceRule.kt index be085a9fc..2941a4d5a 100644 --- a/app/src/main/java/io/legado/app/data/entities/ReplaceRule.kt +++ b/app/src/main/java/io/legado/app/data/entities/ReplaceRule.kt @@ -2,7 +2,10 @@ package io.legado.app.data.entities import android.os.Parcelable import android.text.TextUtils -import androidx.room.* +import androidx.room.ColumnInfo +import androidx.room.Entity +import androidx.room.Index +import androidx.room.PrimaryKey import kotlinx.parcelize.Parcelize import java.util.regex.Pattern import java.util.regex.PatternSyntaxException @@ -26,9 +29,6 @@ data class ReplaceRule( var order: Int = 0 ) : Parcelable { - @Ignore - constructor() : this(id = System.currentTimeMillis()) - override fun equals(other: Any?): Boolean { if (other is ReplaceRule) { return other.id == id diff --git a/app/src/main/java/io/legado/app/data/entities/RssArticle.kt b/app/src/main/java/io/legado/app/data/entities/RssArticle.kt index 8928ddc28..911fb16b8 100644 --- a/app/src/main/java/io/legado/app/data/entities/RssArticle.kt +++ b/app/src/main/java/io/legado/app/data/entities/RssArticle.kt @@ -26,9 +26,6 @@ data class RssArticle( var variable: String? = null ) : RuleDataInterface { - @Ignore - constructor() : this("") - override fun hashCode() = link.hashCode() override fun equals(other: Any?): Boolean { diff --git a/app/src/main/java/io/legado/app/data/entities/RssReadRecord.kt b/app/src/main/java/io/legado/app/data/entities/RssReadRecord.kt index 2a54427dd..edbb4c15d 100644 --- a/app/src/main/java/io/legado/app/data/entities/RssReadRecord.kt +++ b/app/src/main/java/io/legado/app/data/entities/RssReadRecord.kt @@ -1,13 +1,7 @@ package io.legado.app.data.entities import androidx.room.Entity -import androidx.room.Ignore import androidx.room.PrimaryKey @Entity(tableName = "rssReadRecords") -data class RssReadRecord(@PrimaryKey val record: String, val read: Boolean = true) { - - @Ignore - constructor() : this("") - -} \ No newline at end of file +data class RssReadRecord(@PrimaryKey val record: String, val read: Boolean = true) \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/data/entities/RssSource.kt b/app/src/main/java/io/legado/app/data/entities/RssSource.kt index 7f9c97051..78830285a 100644 --- a/app/src/main/java/io/legado/app/data/entities/RssSource.kt +++ b/app/src/main/java/io/legado/app/data/entities/RssSource.kt @@ -2,7 +2,6 @@ package io.legado.app.data.entities import android.os.Parcelable import androidx.room.Entity -import androidx.room.Ignore import androidx.room.Index import androidx.room.PrimaryKey import com.jayway.jsonpath.DocumentContext @@ -44,9 +43,6 @@ data class RssSource( var customOrder: Int = 0 ) : Parcelable, BaseSource { - @Ignore - constructor() : this("") - override fun getTag(): String { return sourceName } diff --git a/app/src/main/java/io/legado/app/data/entities/RssStar.kt b/app/src/main/java/io/legado/app/data/entities/RssStar.kt index fc696cf94..df4bd546f 100644 --- a/app/src/main/java/io/legado/app/data/entities/RssStar.kt +++ b/app/src/main/java/io/legado/app/data/entities/RssStar.kt @@ -25,9 +25,6 @@ data class RssStar( var variable: String? = null ) : RuleDataInterface { - @Ignore - constructor() : this("") - @delegate:Transient @delegate:Ignore @IgnoredOnParcel diff --git a/app/src/main/java/io/legado/app/data/entities/RuleSub.kt b/app/src/main/java/io/legado/app/data/entities/RuleSub.kt index bc9c250d0..2b43787fe 100644 --- a/app/src/main/java/io/legado/app/data/entities/RuleSub.kt +++ b/app/src/main/java/io/legado/app/data/entities/RuleSub.kt @@ -1,7 +1,6 @@ package io.legado.app.data.entities import androidx.room.Entity -import androidx.room.Ignore import androidx.room.PrimaryKey @Entity(tableName = "ruleSubs") @@ -14,9 +13,4 @@ data class RuleSub( var customOrder: Int = 0, var autoUpdate: Boolean = false, var update: Long = System.currentTimeMillis() -) { - - @Ignore - constructor() : this(name = "") - -} +) diff --git a/app/src/main/java/io/legado/app/data/entities/SearchBook.kt b/app/src/main/java/io/legado/app/data/entities/SearchBook.kt index 6169aa6d0..96c525b3a 100644 --- a/app/src/main/java/io/legado/app/data/entities/SearchBook.kt +++ b/app/src/main/java/io/legado/app/data/entities/SearchBook.kt @@ -40,9 +40,6 @@ data class SearchBook( var originOrder: Int = 0 ) : Parcelable, BaseBook, Comparable { - @Ignore - constructor() : this(bookUrl = "") - @Ignore @IgnoredOnParcel override var infoHtml: String? = null diff --git a/app/src/main/java/io/legado/app/data/entities/SearchKeyword.kt b/app/src/main/java/io/legado/app/data/entities/SearchKeyword.kt index ade4a5551..955e5fe3d 100644 --- a/app/src/main/java/io/legado/app/data/entities/SearchKeyword.kt +++ b/app/src/main/java/io/legado/app/data/entities/SearchKeyword.kt @@ -2,7 +2,6 @@ package io.legado.app.data.entities import android.os.Parcelable import androidx.room.Entity -import androidx.room.Ignore import androidx.room.Index import androidx.room.PrimaryKey import kotlinx.parcelize.Parcelize @@ -15,9 +14,4 @@ data class SearchKeyword( var word: String = "", // 搜索关键词 var usage: Int = 1, // 使用次数 var lastUseTime: Long = System.currentTimeMillis() // 最后一次使用时间 -) : Parcelable { - - @Ignore - constructor() : this(word = "") - -} +) : Parcelable