Merge remote-tracking branch 'origin/master' into desirepath

pull/31/head
Invinciblelee 6 years ago
commit df0b8a55d6
  1. 13
      app/src/main/java/io/legado/app/data/entities/Book.kt
  2. 6
      app/src/main/java/io/legado/app/data/entities/Chapter.kt
  3. 19
      app/src/main/java/io/legado/app/data/entities/ReplaceRule.kt
  4. 8
      app/src/main/java/io/legado/app/data/entities/Source.kt

@ -19,15 +19,14 @@ data class Book(@PrimaryKey
var type: Int = 0, // 0: 文本读物, 1: 有声读物 var type: Int = 0, // 0: 文本读物, 1: 有声读物
var group: Int = 0, // 自定义分组索引号 var group: Int = 0, // 自定义分组索引号
var tocUrl: String = "", // 目录页Url (toc=table of Contents) var tocUrl: String = "", // 目录页Url (toc=table of Contents)
var latestChapterName: String? = null, // 最新章节 var latestChapterTitle: String? = null, // 最新章节标题
var lastCheckTime: Long? = null, // 最近一次更新书籍信息的时间 var latestChapterTime: Long = 0, // 最新章节标题更新时间
var hasNewChapter: Boolean = false, // 最近一次更新书籍信息时是否发现新章节 var lastCheckTime: Long = 0, // 最近一次更新书籍信息的时间
var latestChapterTime: Long? = null, // 最近一次发现新章节的时间 var lastCheckCount: Int = 0, // 最近一次发现新章节的数量
var latestCheckCount: Int = 0, // 最近一次发现新章节的数量
var totalChapterNum: Int = 0, // 书籍目录总数 var totalChapterNum: Int = 0, // 书籍目录总数
var durChapterName: String = "", // 当前章节名称 var durChapterTitle: String = "", // 当前章节名称
var durChapterIndex: Int = 0, // 当前章节索引 var durChapterIndex: Int = 0, // 当前章节索引
var durChapterMark: Int = 0, // 当前阅读的进度(首行字符的索引位置) var durChapterPos: Int = 0, // 当前阅读的进度(首行字符的索引位置)
var durChapterTime: Long = 0, // 最近一次阅读书籍的时间(打开正文的时间) var durChapterTime: Long = 0, // 最近一次阅读书籍的时间(打开正文的时间)
var canUpdate: Boolean = true, // 刷新书架时更新书籍信息 var canUpdate: Boolean = true, // 刷新书架时更新书籍信息
var variable: String? = null // 自定义书籍变量信息(用于书源规则检索书籍信息) var variable: String? = null // 自定义书籍变量信息(用于书源规则检索书籍信息)

@ -17,12 +17,12 @@ import kotlinx.android.parcel.Parcelize
onDelete = ForeignKey.CASCADE))]) // 删除书籍时自动删除章节 onDelete = ForeignKey.CASCADE))]) // 删除书籍时自动删除章节
data class Chapter(@PrimaryKey data class Chapter(@PrimaryKey
var url: String = "", // 章节地址 var url: String = "", // 章节地址
var name: String = "", // 章节标题 var title: String = "", // 章节标题
var bookUrl: String = "", // 书籍地址 var bookUrl: String = "", // 书籍地址
var index: Int = 0, // 章节序号 var index: Int = 0, // 章节序号
var resourceUrl: String? = null, // 音频真实URL var resourceUrl: String? = null, // 音频真实URL
var tag: String? = null, // var tag: String? = null, //
var start: Long? = null, // 章节起始地址 var start: Long? = null, // 章节起始位置
var end: Long? = null // 章节终止地址 var end: Long? = null // 章节终止位置
) : Parcelable ) : Parcelable

@ -9,15 +9,16 @@ import kotlinx.android.parcel.Parcelize
@Parcelize @Parcelize
@Entity(tableName = "replace_rules", @Entity(tableName = "replace_rules",
indices = [(Index(value = ["id"]))]) indices = [(Index(value = ["id"]))])
data class ReplaceRule(@PrimaryKey data class ReplaceRule(
val id: Int = 0, @PrimaryKey(autoGenerate = true)
val summary: String? = null, val id: Int = 0,
val pattern: String? = null, val summary: String? = null,
val replacement: String? = null, val pattern: String? = null,
val scope: String? = null, val replacement: String? = null,
val isEnabled: Boolean? = null, val scope: String? = null,
val isRegex: Boolean? = null, val isEnabled: Boolean? = null,
val order: Int = 0 val isRegex: Boolean? = null,
val order: Int = 0
) : Parcelable ) : Parcelable

@ -1,6 +1,7 @@
package io.legado.app.data.entities package io.legado.app.data.entities
import android.os.Parcelable import android.os.Parcelable
import androidx.room.ColumnInfo
import androidx.room.Entity import androidx.room.Entity
import androidx.room.Index import androidx.room.Index
import androidx.room.PrimaryKey import androidx.room.PrimaryKey
@ -8,11 +9,12 @@ import kotlinx.android.parcel.Parcelize
@Parcelize @Parcelize
@Entity(tableName = "sources", @Entity(tableName = "sources",
indices = [(Index(value = ["id"]))]) indices = [(Index(value = ["sourceId"]))])
data class Source(@PrimaryKey data class Source(@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = "sourceId")
var id: Int = 0, // 编号 var id: Int = 0, // 编号
var host: String = "", // 地址,包括 http/https
var name: String = "", // 名称 var name: String = "", // 名称
var origin: String = "", // 地址,包括 http/https
var type: Int = 0, // 类型,0 文本,1 音频 var type: Int = 0, // 类型,0 文本,1 音频
var group: String? = null, // 分组 var group: String? = null, // 分组
var header: String? = null, // header var header: String? = null, // header

Loading…
Cancel
Save