Merge pull request #28 from gedoor/master

update
pull/29/head
Antecer 6 years ago committed by GitHub
commit 6de726fb80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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 group: Int = 0, // 自定义分组索引号
var tocUrl: String = "", // 目录页Url (toc=table of Contents)
var latestChapterName: String? = null, // 最新章节
var lastCheckTime: Long? = null, // 最近一次更新书籍信息的时间
var hasNewChapter: Boolean = false, // 最近一次更新书籍信息时是否发现新章节
var latestChapterTime: Long? = null, // 最近一次发现新章节的时间
var latestCheckCount: Int = 0, // 最近一次发现新章节的数量
var latestChapterTitle: String? = null, // 最新章节标题
var latestChapterTime: Long = 0, // 最新章节标题更新时间
var lastCheckTime: Long = 0, // 最近一次更新书籍信息的时间
var lastCheckCount: Int = 0, // 最近一次发现新章节的数量
var totalChapterNum: Int = 0, // 书籍目录总数
var durChapterName: String = "", // 当前章节名称
var durChapterTitle: String = "", // 当前章节名称
var durChapterIndex: Int = 0, // 当前章节索引
var durChapterMark: Int = 0, // 当前阅读的进度(首行字符的索引位置)
var durChapterPos: Int = 0, // 当前阅读的进度(首行字符的索引位置)
var durChapterTime: Long = 0, // 最近一次阅读书籍的时间(打开正文的时间)
var canUpdate: Boolean = true, // 刷新书架时更新书籍信息
var variable: String? = null // 自定义书籍变量信息(用于书源规则检索书籍信息)

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

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

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

Loading…
Cancel
Save