pull/1463/head^2
gedoor 3 years ago
parent eb738c4e0d
commit 0ffe39a157
  1. 2
      app/build.gradle
  2. 3
      app/src/main/java/io/legado/app/data/entities/Book.kt
  3. 3
      app/src/main/java/io/legado/app/data/entities/BookChapter.kt
  4. 4
      app/src/main/java/io/legado/app/data/entities/BookGroup.kt
  5. 3
      app/src/main/java/io/legado/app/data/entities/BookSource.kt
  6. 8
      app/src/main/java/io/legado/app/data/entities/Bookmark.kt
  7. 8
      app/src/main/java/io/legado/app/data/entities/Cache.kt
  8. 8
      app/src/main/java/io/legado/app/data/entities/Cookie.kt
  9. 4
      app/src/main/java/io/legado/app/data/entities/HttpTTS.kt
  10. 8
      app/src/main/java/io/legado/app/data/entities/ReadRecord.kt
  11. 9
      app/src/main/java/io/legado/app/data/entities/ReadRecordShow.kt
  12. 8
      app/src/main/java/io/legado/app/data/entities/ReplaceRule.kt
  13. 3
      app/src/main/java/io/legado/app/data/entities/RssArticle.kt
  14. 8
      app/src/main/java/io/legado/app/data/entities/RssReadRecord.kt
  15. 4
      app/src/main/java/io/legado/app/data/entities/RssSource.kt
  16. 3
      app/src/main/java/io/legado/app/data/entities/RssStar.kt
  17. 8
      app/src/main/java/io/legado/app/data/entities/RuleSub.kt
  18. 3
      app/src/main/java/io/legado/app/data/entities/SearchBook.kt
  19. 8
      app/src/main/java/io/legado/app/data/entities/SearchKeyword.kt

@ -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")

@ -56,9 +56,6 @@ data class Book(
var readConfig: ReadConfig? = null
) : Parcelable, BaseBook {
@Ignore
constructor() : this(bookUrl = "")
fun isLocalBook(): Boolean {
return origin == BookType.local
}

@ -47,9 +47,6 @@ data class BookChapter(
var variable: String? = null //变量
) : Parcelable, RuleDataInterface {
@Ignore
constructor() : this(url = "", bookUrl = "")
@delegate:Transient
@delegate:Ignore
@IgnoredOnParcel

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

@ -46,9 +46,6 @@ data class BookSource(
var ruleContent: ContentRule? = null // 正文页规则
) : Parcelable, BaseSource {
@Ignore
constructor() : this(bookSourceUrl = "")
override fun getTag(): String {
return bookSourceName
}

@ -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())
}
) : Parcelable

@ -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 = "")
}
)

@ -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 = "")
}
)

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

@ -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 = "")
}
)

@ -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("")
}
)

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

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

@ -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("")
}
data class RssReadRecord(@PrimaryKey val record: String, val read: Boolean = true)

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

@ -25,9 +25,6 @@ data class RssStar(
var variable: String? = null
) : RuleDataInterface {
@Ignore
constructor() : this("")
@delegate:Transient
@delegate:Ignore
@IgnoredOnParcel

@ -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 = "")
}
)

@ -40,9 +40,6 @@ data class SearchBook(
var originOrder: Int = 0
) : Parcelable, BaseBook, Comparable<SearchBook> {
@Ignore
constructor() : this(bookUrl = "")
@Ignore
@IgnoredOnParcel
override var infoHtml: String? = null

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

Loading…
Cancel
Save