Explorar o código

添加isVolume规则

Xwite %!s(int64=4) %!d(string=hai) anos
pai
achega
435232fbf4

+ 5 - 0
app/src/main/assets/web/bookSource/index.html

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

+ 1 - 1
app/src/main/java/io/legado/app/data/AppDatabase.kt

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

+ 8 - 1
app/src/main/java/io/legado/app/data/DatabaseMigrations.kt

@@ -38,7 +38,8 @@ object DatabaseMigrations {
             migration_38_39,
             migration_38_39,
             migration_39_40,
             migration_39_40,
             migration_40_41,
             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")
             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")
+        }
+    }
 }
 }

+ 1 - 0
app/src/main/java/io/legado/app/data/entities/BookChapter.kt

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

+ 1 - 0
app/src/main/java/io/legado/app/data/entities/rule/TocRule.kt

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

+ 2 - 0
app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt

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

+ 1 - 0
app/src/main/res/values-es-rES/strings.xml

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

+ 1 - 0
app/src/main/res/values-ja-rJP/strings.xml

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

+ 1 - 0
app/src/main/res/values-zh-rHK/strings.xml

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

+ 1 - 0
app/src/main/res/values-zh-rTW/strings.xml

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

+ 1 - 0
app/src/main/res/values-zh/strings.xml

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

+ 1 - 0
app/src/main/res/values/strings.xml

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