pull/32/head
kunfei 5 years ago
parent bedc0e7812
commit 3c6b62adf5
  1. 7
      app/src/main/java/io/legado/app/data/entities/Book.kt

@ -6,7 +6,6 @@ import androidx.room.Entity
import androidx.room.Ignore import androidx.room.Ignore
import androidx.room.Index import androidx.room.Index
import androidx.room.PrimaryKey import androidx.room.PrimaryKey
import io.legado.app.constant.AppConst.NOT_AVAILABLE
import io.legado.app.utils.GSON import io.legado.app.utils.GSON
import io.legado.app.utils.fromJsonObject import io.legado.app.utils.fromJsonObject
import kotlinx.android.parcel.IgnoredOnParcel import kotlinx.android.parcel.IgnoredOnParcel
@ -20,9 +19,7 @@ data class Book(
var tocUrl: String = "", // 目录页Url (toc=table of Contents) var tocUrl: String = "", // 目录页Url (toc=table of Contents)
var origin: String = "", // 书源URL(默认BookType.local) var origin: String = "", // 书源URL(默认BookType.local)
var name: String? = null, // 书籍名称(书源获取) var name: String? = null, // 书籍名称(书源获取)
var customName: String? = null, // 书籍名称(用户修改)
var author: String? = null, // 作者名称(书源获取) var author: String? = null, // 作者名称(书源获取)
var customAuthor: String? = null, // 作者名称(用户修改)
var tag: String? = null, // 分类信息(书源获取) var tag: String? = null, // 分类信息(书源获取)
var customTag: String? = null, // 分类信息(用户修改) var customTag: String? = null, // 分类信息(用户修改)
var coverUrl: String? = null, // 封面Url(书源获取) var coverUrl: String? = null, // 封面Url(书源获取)
@ -56,10 +53,6 @@ data class Book(
fun getUnreadChapterNum() = Math.max(totalChapterNum - durChapterIndex - 1, 0) fun getUnreadChapterNum() = Math.max(totalChapterNum - durChapterIndex - 1, 0)
fun getDisplayName() = customName ?: name ?: NOT_AVAILABLE
fun getDisplayAuthor() = customAuthor ?: author ?: NOT_AVAILABLE
fun getDisplayCover() = customCoverUrl ?: coverUrl fun getDisplayCover() = customCoverUrl ?: coverUrl
fun getDisplayDescription() = customDescription ?: description fun getDisplayDescription() = customDescription ?: description

Loading…
Cancel
Save