添加isVolume规则

This commit is contained in:
Xwite 2022-01-09 23:03:21 +08:00
parent 9bf98783df
commit 4e151ca303
12 changed files with 24 additions and 2 deletions

View File

@ -250,6 +250,11 @@
<textarea rows="1" id="ruleToc_chapterUrl" class="ruleToc" title="chapterUrl"
placeholder="选择章节链接 (规则结果为String类型的Url)"></textarea>
</div>
<div>
<div>Volume标识:</div>
<textarea rows="1" id="ruleToc_isVolume" class="ruleToc" title="isVolume"
placeholder="章节名称是否是卷名 (规则结果为Bool)"></textarea>
</div>
<div>
<div>收费标识:</div>
<textarea rows="1" id="ruleToc_isVip" class="ruleToc" title="isVip"

View File

@ -16,7 +16,7 @@ val appDb by lazy {
}
@Database(
version = 42,
version = 43,
exportSchema = true,
entities = [Book::class, BookGroup::class, BookSource::class, BookChapter::class,
ReplaceRule::class, SearchBook::class, SearchKeyword::class, Cookie::class,

View File

@ -38,7 +38,8 @@ object DatabaseMigrations {
migration_38_39,
migration_39_40,
migration_40_41,
migration_41_42
migration_41_42,
migration_42_43
)
}
@ -336,4 +337,10 @@ object DatabaseMigrations {
database.execSQL("ALTER TABLE 'httpTTS' ADD `contentType` TEXT")
}
}
private val migration_42_43 = object : Migration(42, 43) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("ALTER TABLE `chapters` ADD `isVolume` INTEGER NOT NULL DEFAULT 0")
}
}
}

View File

@ -33,6 +33,7 @@ import splitties.init.appCtx
data class BookChapter(
var url: String = "", // 章节地址
var title: String = "", // 章节标题
var isVolume: Boolean = false, // 是否是卷名
var baseUrl: String = "", // 用来拼接相对url
var bookUrl: String = "", // 书籍地址
var index: Int = 0, // 章节序号

View File

@ -8,6 +8,7 @@ data class TocRule(
var chapterList: String? = null,
var chapterName: String? = null,
var chapterUrl: String? = null,
var isVolume: String? = null,
var isVip: String? = null,
var isPay: String? = null,
var updateTime: String? = null,

View File

@ -265,6 +265,7 @@ class BookSourceEditActivity :
add(EditEntity("chapterList", tr?.chapterList, R.string.rule_chapter_list))
add(EditEntity("chapterName", tr?.chapterName, R.string.rule_chapter_name))
add(EditEntity("chapterUrl", tr?.chapterUrl, R.string.rule_chapter_url))
add(EditEntity("isVolume", tr?.isVolume, R.string.rule_is_volume))
add(EditEntity("updateTime", tr?.updateTime, R.string.rule_update_time))
add(EditEntity("isVip", tr?.isVip, R.string.rule_is_vip))
add(EditEntity("isPay", tr?.isPay, R.string.rule_is_pay))
@ -360,6 +361,7 @@ class BookSourceEditActivity :
"chapterList" -> tocRule.chapterList = it.value
"chapterName" -> tocRule.chapterName = it.value
"chapterUrl" -> tocRule.chapterUrl = it.value
"isVolume" -> tocRule.isVolume = it.value
"updateTime" -> tocRule.updateTime = it.value
"isVip" -> tocRule.isVip = it.value
"isPay" -> tocRule.isPay = it.value

View File

@ -414,6 +414,7 @@
<string name="rule_chapter_list">目录列表规则(chapterList)</string>
<string name="rule_chapter_name">章节名称规则(ChapterName)</string>
<string name="rule_chapter_url">章节URL规则(chapterUrl)</string>
<string name="rule_is_volume">Volume mark(isVolume)</string>
<string name="rule_is_vip">VIP标识(isVip)</string>
<string name="rule_update_time">更新时间(ChapterInfo)</string>
<string name="rule_book_content">正文规则(content)</string>

View File

@ -418,6 +418,7 @@
<string name="rule_chapter_list">目录列表规则(chapterList)</string>
<string name="rule_chapter_name">章节名称规则(ChapterName)</string>
<string name="rule_chapter_url">章节URL规则(chapterUrl)</string>
<string name="rule_is_volume">Volume mark(isVolume)</string>
<string name="rule_is_vip">VIP标识(isVip)</string>
<string name="rule_update_time">更新时间(ChapterInfo)</string>
<string name="rule_book_content">正文规则(content)</string>

View File

@ -413,6 +413,7 @@
<string name="rule_chapter_list">目錄列表規則 (chapterList)</string>
<string name="rule_chapter_name">章節名稱規則 (ChapterName)</string>
<string name="rule_chapter_url">章節 URL 規則 (chapterUrl)</string>
<string name="rule_is_volume">Volume標識(isVolume)</string>
<string name="rule_is_vip">VIP 標識 (isVip)</string>
<string name="rule_update_time">更新時間 (ChapterInfo)</string>
<string name="rule_book_content">正文規則 (content)</string>

View File

@ -417,6 +417,7 @@
<string name="rule_chapter_list">目錄列表規則(chapterList)</string>
<string name="rule_chapter_name">章節名稱規則(ChapterName)</string>
<string name="rule_chapter_url">章節URL規則(chapterUrl)</string>
<string name="rule_is_volume">Volume標識(isVolume)</string>
<string name="rule_is_vip">VIP標識(isVip)</string>
<string name="rule_update_time">更新時間(ChapterInfo)</string>
<string name="rule_book_content">正文規則(content)</string>

View File

@ -417,6 +417,7 @@
<string name="rule_chapter_list">目录列表规则(chapterList)</string>
<string name="rule_chapter_name">章节名称规则(ChapterName)</string>
<string name="rule_chapter_url">章节URL规则(chapterUrl)</string>
<string name="rule_is_volume">Volume标识(isVolume)</string>
<string name="rule_is_vip">VIP标识(isVip)</string>
<string name="rule_update_time">更新时间(ChapterInfo)</string>
<string name="rule_book_content">正文规则(content)</string>

View File

@ -418,6 +418,7 @@
<string name="rule_chapter_list">目录列表规则(chapterList)</string>
<string name="rule_chapter_name">章节名称规则(ChapterName)</string>
<string name="rule_chapter_url">章节URL规则(chapterUrl)</string>
<string name="rule_is_volume">Volume标识(isVolume)</string>
<string name="rule_is_vip">VIP标识(isVip)</string>
<string name="rule_update_time">更新时间(ChapterInfo)</string>
<string name="rule_book_content">正文规则(content)</string>