From 891f6ed404315c9983a0417d385f75bd8374802a Mon Sep 17 00:00:00 2001 From: atbest Date: Thu, 23 May 2019 01:49:40 -0400 Subject: [PATCH 1/3] Updated entities --- app/src/main/java/io/legado/app/data/entities/Book.kt | 2 +- app/src/main/java/io/legado/app/data/entities/ReplaceRule.kt | 4 ++-- app/src/main/java/io/legado/app/data/entities/Source.kt | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) 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 e207f8c03..ace8e1b1d 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 @@ -5,7 +5,7 @@ import androidx.room.* import kotlinx.android.parcel.Parcelize @Parcelize -@Entity(tableName = "books", indices = [(Index(value = ["descUrl"]))]) +@Entity(tableName = "books", indices = [(Index(value = ["descUrl"], unique = true))]) data class Book(@PrimaryKey var descUrl: String = "", // 详情页Url(本地书源存储完整文件路径) var sourceId: Int = -1, // 书源规则id(默认-1,表示本地书籍) 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 fdfa41d3f..2436fb641 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 @@ -16,8 +16,8 @@ data class ReplaceRule( val pattern: String? = null, val replacement: String? = null, val scope: String? = null, - val isEnabled: Boolean? = null, - val isRegex: Boolean? = null, + val isEnabled: Boolean = true, + val isRegex: Boolean = true, val order: Int = 0 ) : Parcelable diff --git a/app/src/main/java/io/legado/app/data/entities/Source.kt b/app/src/main/java/io/legado/app/data/entities/Source.kt index 1c6cfcf18..aa38236b5 100644 --- a/app/src/main/java/io/legado/app/data/entities/Source.kt +++ b/app/src/main/java/io/legado/app/data/entities/Source.kt @@ -14,14 +14,14 @@ data class Source(@PrimaryKey(autoGenerate = true) @ColumnInfo(name = "sourceId") var id: Int = 0, // 编号 var name: String = "", // 名称 - var origin: String = "", // 地址,包括 http/https + var origin: String = "", // 地址,包括 http/https var type: Int = 0, // 类型,0 文本,1 音频 var group: String? = null, // 分组 var header: String? = null, // header var loginUrl: String? = null, // 登录地址 var isEnabled: Boolean = true, // 是否启用 var lastUpdateTime: Long = 0, // 最后更新时间,用于排序 - var serialNumber: Int = 0, // 手动排序编号 + var customOrder: Int = 0, // 手动排序编号 var weight: Int = 0, // 智能排序的权重 var exploreRule: String? = null, // 发现规则 var searchRule: String? = null, // 搜索规则 From 11f7c21adce8688fae0b7eeb6fbd10c01d60001a Mon Sep 17 00:00:00 2001 From: Antecer Date: Thu, 23 May 2019 14:04:20 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9Book=E5=B1=9E=E6=80=A7,?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=AD=97=E6=AE=B5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/data/entities/Book.kt | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) 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 e207f8c03..d0ba835d7 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 @@ -9,14 +9,18 @@ import kotlinx.android.parcel.Parcelize data class Book(@PrimaryKey var descUrl: String = "", // 详情页Url(本地书源存储完整文件路径) var sourceId: Int = -1, // 书源规则id(默认-1,表示本地书籍) - var name: String = "", // 书籍名称(允许用户修改,适用于本地书籍) - var author: String? = null, // 作者名称(允许用户修改,适用于本地书籍) - var tag: String? = null, // 分类信息(允许用户修改,适用于本地书籍) - var coverUrl: String? = null, // 封面Url - var customCoverUrl: String? = null, // 自定义封面Url(允许用户修改,适用于网络和本地书籍) - var description: String? = null, // 简介内容(允许用户修改,适用于网络和本地书籍) + var name: String = "", // 书籍名称(书源获取) + var customName: String = "", // 书籍名称(用户修改) + var author: String? = null, // 作者名称(书源获取) + var customAuthor: String? = null, // 作者名称(用户修改) + var tag: String? = null, // 分类信息(书源获取) + var customTag: String? = null, // 分类信息(用户修改) + var coverUrl: String? = null, // 封面Url(书源获取) + var customCoverUrl: String? = null, // 封面Url(用户修改) + var description: String? = null, // 简介内容(书源获取) + var customDescription: String? = null, // 简介内容(用户修改) var charset: String? = null, // 自定义字符集名称(仅适用于本地书籍) - var type: Int = 0, // 0: 文本读物, 1: 有声读物 + var type: Int = 0, // 0: 文本读物, 1: 有声读物, 3: 本地书籍 var group: Int = 0, // 自定义分组索引号 var tocUrl: String = "", // 目录页Url (toc=table of Contents) var latestChapterTitle: String? = null, // 最新章节标题 From 7656572c771a70795ab9cdb28699aa942c272214 Mon Sep 17 00:00:00 2001 From: Antecer Date: Thu, 23 May 2019 14:06:42 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=8D=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E7=9A=84=E6=B3=A8=E9=87=8A.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/data/entities/Book.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d0ba835d7..b929e183c 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 @@ -20,7 +20,7 @@ data class Book(@PrimaryKey var description: String? = null, // 简介内容(书源获取) var customDescription: String? = null, // 简介内容(用户修改) var charset: String? = null, // 自定义字符集名称(仅适用于本地书籍) - var type: Int = 0, // 0: 文本读物, 1: 有声读物, 3: 本地书籍 + var type: Int = 0, // 0: 文本读物, 1: 有声读物 var group: Int = 0, // 自定义分组索引号 var tocUrl: String = "", // 目录页Url (toc=table of Contents) var latestChapterTitle: String? = null, // 最新章节标题