# Conflicts: # app/src/main/res/values/strings.xmlpull/30/head
commit
2734464f5b
@ -1 +1,2 @@ |
|||||||
/build |
/build |
||||||
|
/schemas |
||||||
|
@ -1,33 +1,37 @@ |
|||||||
package io.legado.app.data.entities |
package io.legado.app.data.entities |
||||||
|
|
||||||
import android.annotation.SuppressLint |
|
||||||
import android.os.Parcelable |
import android.os.Parcelable |
||||||
import androidx.room.* |
import androidx.room.* |
||||||
import kotlinx.android.parcel.Parcelize |
import kotlinx.android.parcel.Parcelize |
||||||
|
|
||||||
@Parcelize |
@Parcelize |
||||||
@Entity(tableName = "books", |
@Entity(tableName = "books", indices = [(Index(value = ["descUrl"]))]) |
||||||
indices = [(Index(value = ["url"]))]) |
|
||||||
data class Book(@PrimaryKey |
data class Book(@PrimaryKey |
||||||
var url: String = "", |
var descUrl: String = "", // 详情页Url(本地书源存储完整文件路径) |
||||||
var name: String = "", |
var sourceId: Int = -1, // 书源规则id(默认-1,表示本地书籍) |
||||||
var tag: String = "", |
var name: String = "", // 书籍名称(允许用户修改,适用于本地书籍) |
||||||
var author: String? = null, |
var author: String? = null, // 作者名称(允许用户修改,适用于本地书籍) |
||||||
var coverUrl: String? = null, |
var tag: String? = null, // 分类信息(允许用户修改,适用于本地书籍) |
||||||
var customCoverUrl: String? = null, |
var coverUrl: String? = null, // 封面Url |
||||||
var introduction: String? = null, |
var customCoverUrl: String? = null, // 自定义封面Url |
||||||
var charset: String? = null, |
var description: String? = null, // 简介内容 |
||||||
var type: Int = 0, // 0: text, 1: audio |
var charset: String? = null, // 自定义字符集名称(仅适用于本地书籍) |
||||||
var group: Int = 0, // fenqu |
var type: Int = 0, // 0: 文本读物, 1: 有声读物 |
||||||
var latestChapterName: String? = null, |
var group: Int = 0, // 自定义分组索引号 |
||||||
var lastUpdateTime: Long? = null, |
var tocUrl: String = "", // 目录页Url (toc=table of Contents) |
||||||
var latestChapterTime: Long? = null, |
var latestChapterName: String? = null, // 最新章节 |
||||||
var durChapterIndex: Int = 0, |
var lastCheckTime: Long? = null, // 最近一次更新书籍信息的时间 |
||||||
var durChapterPage: Int = 0, |
var latestChapterTime: Long? = null, // 最近一次发现新章节的时间 |
||||||
var totalChapterNum: Int = 0, |
var lastUpdateChapters: Int = 0, // 最近一次发现新章节的数量 |
||||||
var hasNewChapter: Boolean = false, |
var durChapterName: String = "", // 当前阅读的章节名称 |
||||||
var allowUpdate: Boolean = true |
var durChapterIndex: Int = 0, // 当前阅读的章节分页索引 |
||||||
) : Parcelable { |
var durChapterPage: Int = 0, // 当前阅读的章节总分页数 |
||||||
|
var durChapterTime: Long = 0, // 最后一次阅读书籍的时间(打开正文的时间) |
||||||
|
var totalChapterNum: Int = 0, // 书籍目录总数 |
||||||
|
var hasNewChapter: Boolean = false, // 是否在最后一次更新书籍信息时找到新章节 |
||||||
|
var allowUpdate: Boolean = true, // 是否允许阅读自动管理更新书籍信息 |
||||||
|
var variable: String? = null // 自定义书籍变量信息(用于书源规则检索书籍信息) |
||||||
|
) : Parcelable { |
||||||
|
|
||||||
fun getUnreadChapterNum() = Math.max(totalChapterNum - durChapterIndex - 1, 0) |
fun getUnreadChapterNum() = Math.max(totalChapterNum - durChapterIndex - 1, 0) |
||||||
|
|
||||||
|
@ -0,0 +1,23 @@ |
|||||||
|
package io.legado.app.data.entities |
||||||
|
|
||||||
|
import android.os.Parcelable |
||||||
|
import androidx.room.Entity |
||||||
|
import androidx.room.Index |
||||||
|
import androidx.room.PrimaryKey |
||||||
|
import kotlinx.android.parcel.Parcelize |
||||||
|
|
||||||
|
|
||||||
|
@Parcelize |
||||||
|
@Entity(tableName = "chapters", |
||||||
|
indices = [(Index(value = ["url"]))]) |
||||||
|
data class Chapter(@PrimaryKey |
||||||
|
var url: String = "", |
||||||
|
var name: String = "", |
||||||
|
var bookUrl: String = "", |
||||||
|
var index: Int = 0, |
||||||
|
var resourceUrl: String? = null, |
||||||
|
var tag: String? = null, |
||||||
|
var start: Long? = null, |
||||||
|
var end: Long? = null |
||||||
|
) : Parcelable |
||||||
|
|
@ -0,0 +1,23 @@ |
|||||||
|
package io.legado.app.data.entities |
||||||
|
|
||||||
|
import android.os.Parcelable |
||||||
|
import androidx.room.Entity |
||||||
|
import androidx.room.Index |
||||||
|
import androidx.room.PrimaryKey |
||||||
|
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 |
||||||
|
) : Parcelable |
||||||
|
|
||||||
|
|
@ -0,0 +1,5 @@ |
|||||||
|
package io.legado.app.data.entities |
||||||
|
|
||||||
|
class Rule { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,2 @@ |
|||||||
|
package io.legado.app.data.entities |
||||||
|
|
@ -0,0 +1,5 @@ |
|||||||
|
package io.legado.app.ui.main |
||||||
|
|
||||||
|
class MainModel { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,9 @@ |
|||||||
|
package io.legado.app.ui.main |
||||||
|
|
||||||
|
import android.app.Application |
||||||
|
import androidx.lifecycle.AndroidViewModel |
||||||
|
|
||||||
|
class MainViewModel(application: Application) : AndroidViewModel(application) { |
||||||
|
|
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue