pull/517/head
gedoor 4 years ago
parent ac5bd2de89
commit efb880484b
  1. 2
      app/src/main/java/io/legado/app/data/entities/rule/BookInfoRule.kt
  2. 2
      app/src/main/java/io/legado/app/model/webBook/BookInfo.kt
  3. 2
      app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt
  4. 1
      app/src/main/res/values-zh-rHK/strings.xml
  5. 1
      app/src/main/res/values-zh-rTW/strings.xml
  6. 1
      app/src/main/res/values-zh/strings.xml
  7. 1
      app/src/main/res/values/strings.xml

@ -16,5 +16,5 @@ data class BookInfoRule(
var coverUrl: String? = null, var coverUrl: String? = null,
var tocUrl: String? = null, var tocUrl: String? = null,
var wordCount: String? = null, var wordCount: String? = null,
var canReName: Boolean? = null var canReName: String? = null
) : Parcelable ) : Parcelable

@ -34,7 +34,7 @@ object BookInfo {
analyzeRule.setContent(analyzeRule.getElement(it)) analyzeRule.setContent(analyzeRule.getElement(it))
} }
} }
val mCanReName = canReName && infoRule.canReName == true val mCanReName = canReName && !infoRule.canReName.isNullOrBlank()
Debug.log(bookSource.bookSourceUrl, "┌获取书名") Debug.log(bookSource.bookSourceUrl, "┌获取书名")
BookHelp.formatBookName(analyzeRule.getString(infoRule.name)).let { BookHelp.formatBookName(analyzeRule.getString(infoRule.name)).let {
if (it.isNotEmpty() && (mCanReName || book.name.isEmpty())) { if (it.isNotEmpty() && (mCanReName || book.name.isEmpty())) {

@ -219,6 +219,7 @@ class BookSourceEditActivity :
add(EditEntity("intro", ir?.intro, R.string.rule_book_intro)) add(EditEntity("intro", ir?.intro, R.string.rule_book_intro))
add(EditEntity("coverUrl", ir?.coverUrl, R.string.rule_cover_url)) add(EditEntity("coverUrl", ir?.coverUrl, R.string.rule_cover_url))
add(EditEntity("tocUrl", ir?.tocUrl, R.string.rule_toc_url)) add(EditEntity("tocUrl", ir?.tocUrl, R.string.rule_toc_url))
add(EditEntity("canReName", ir?.canReName, R.string.rule_can_re_name))
} }
//目录页 //目录页
val tr = source?.getTocRule() val tr = source?.getTocRule()
@ -324,6 +325,7 @@ class BookSourceEditActivity :
"lastChapter" -> bookInfoRule.lastChapter = it.value "lastChapter" -> bookInfoRule.lastChapter = it.value
"coverUrl" -> bookInfoRule.coverUrl = it.value "coverUrl" -> bookInfoRule.coverUrl = it.value
"tocUrl" -> bookInfoRule.tocUrl = it.value "tocUrl" -> bookInfoRule.tocUrl = it.value
"canReName" -> bookInfoRule.canReName = it.value
} }
} }
tocEntities.forEach { tocEntities.forEach {

@ -403,6 +403,7 @@
<string name="book_url_pattern">書籍 URL 正則 (bookUrlPattern)</string> <string name="book_url_pattern">書籍 URL 正則 (bookUrlPattern)</string>
<string name="rule_book_info_init">預處理規則 (bookInfoInit)</string> <string name="rule_book_info_init">預處理規則 (bookInfoInit)</string>
<string name="rule_toc_url">目錄 URL 規則 (tocUrl)</string> <string name="rule_toc_url">目錄 URL 規則 (tocUrl)</string>
<string name="rule_can_re_name">允许修改书名作者(canReName)</string>
<string name="rule_next_toc_url">目錄下一頁規則 (nextTocUrl)</string> <string name="rule_next_toc_url">目錄下一頁規則 (nextTocUrl)</string>
<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>

@ -404,6 +404,7 @@
<string name="book_url_pattern">書籍URL正則(bookUrlPattern)</string> <string name="book_url_pattern">書籍URL正則(bookUrlPattern)</string>
<string name="rule_book_info_init">預處理規則(bookInfoInit)</string> <string name="rule_book_info_init">預處理規則(bookInfoInit)</string>
<string name="rule_toc_url">目錄URL規則(tocUrl)</string> <string name="rule_toc_url">目錄URL規則(tocUrl)</string>
<string name="rule_can_re_name">允许修改书名作者(canReName)</string>
<string name="rule_next_toc_url">目錄下一頁規則(nextTocUrl)</string> <string name="rule_next_toc_url">目錄下一頁規則(nextTocUrl)</string>
<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>

@ -409,6 +409,7 @@
<string name="book_url_pattern">书籍URL正则(bookUrlPattern)</string> <string name="book_url_pattern">书籍URL正则(bookUrlPattern)</string>
<string name="rule_book_info_init">预处理规则(bookInfoInit)</string> <string name="rule_book_info_init">预处理规则(bookInfoInit)</string>
<string name="rule_toc_url">目录URL规则(tocUrl)</string> <string name="rule_toc_url">目录URL规则(tocUrl)</string>
<string name="rule_can_re_name">允许修改书名作者(canReName)</string>
<string name="rule_next_toc_url">目录下一页规则(nextTocUrl)</string> <string name="rule_next_toc_url">目录下一页规则(nextTocUrl)</string>
<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>

@ -411,6 +411,7 @@
<string name="book_url_pattern">书籍URL正则(bookUrlPattern)</string> <string name="book_url_pattern">书籍URL正则(bookUrlPattern)</string>
<string name="rule_book_info_init">预处理规则(bookInfoInit)</string> <string name="rule_book_info_init">预处理规则(bookInfoInit)</string>
<string name="rule_toc_url">目录URL规则(tocUrl)</string> <string name="rule_toc_url">目录URL规则(tocUrl)</string>
<string name="rule_can_re_name">允许修改书名作者(canReName)</string>
<string name="rule_next_toc_url">目录下一页规则(nextTocUrl)</string> <string name="rule_next_toc_url">目录下一页规则(nextTocUrl)</string>
<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>

Loading…
Cancel
Save