替换规则添加作用于标题和作用于正文

pull/1606/head
kunfei 3 years ago
parent edf5890cb1
commit b592d338ca
  1. 1557
      app/schemas/io.legado.app.data.AppDatabase/44.json
  2. 6
      app/src/main/java/io/legado/app/data/AppDatabase.kt
  3. 21
      app/src/main/java/io/legado/app/data/entities/ReplaceRule.kt

File diff suppressed because it is too large Load Diff

@ -1,6 +1,7 @@
package io.legado.app.data
import android.content.Context
import androidx.room.AutoMigration
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
@ -16,13 +17,14 @@ val appDb by lazy {
}
@Database(
version = 43,
version = 44,
exportSchema = true,
entities = [Book::class, BookGroup::class, BookSource::class, BookChapter::class,
ReplaceRule::class, SearchBook::class, SearchKeyword::class, Cookie::class,
RssSource::class, Bookmark::class, RssArticle::class, RssReadRecord::class,
RssStar::class, TxtTocRule::class, ReadRecord::class, HttpTTS::class, Cache::class,
RuleSub::class]
RuleSub::class],
autoMigrations = [AutoMigration(from = 43, to = 44)]
)
abstract class AppDatabase : RoomDatabase() {

@ -18,14 +18,33 @@ import java.util.regex.PatternSyntaxException
data class ReplaceRule(
@PrimaryKey(autoGenerate = true)
var id: Long = System.currentTimeMillis(),
//名称
@ColumnInfo(defaultValue = "")
var name: String = "",
//分组
var group: String? = null,
//替换内容
@ColumnInfo(defaultValue = "")
var pattern: String = "",
//替换为
@ColumnInfo(defaultValue = "")
var replacement: String = "",
//作用范围
var scope: String? = null,
//作用于标题
@ColumnInfo(defaultValue = "0")
var scopeTitle: Boolean = false,
//作用于正文
@ColumnInfo(defaultValue = "1")
var scopeContent: Boolean = true,
//是否启用
@ColumnInfo(defaultValue = "1")
var isEnabled: Boolean = true,
//是否正则
@ColumnInfo(defaultValue = "1")
var isRegex: Boolean = true,
@ColumnInfo(name = "sortOrder")
//排序
@ColumnInfo(name = "sortOrder", defaultValue = "0")
var order: Int = 0
) : Parcelable {

Loading…
Cancel
Save