diff --git a/app/src/main/java/io/legado/app/data/entities/rule/BookInfoRule.kt b/app/src/main/java/io/legado/app/data/entities/rule/BookInfoRule.kt index e04320b94..9f3a0c9d0 100644 --- a/app/src/main/java/io/legado/app/data/entities/rule/BookInfoRule.kt +++ b/app/src/main/java/io/legado/app/data/entities/rule/BookInfoRule.kt @@ -16,5 +16,5 @@ data class BookInfoRule( var coverUrl: String? = null, var tocUrl: String? = null, var wordCount: String? = null, - var canReName: Boolean? = null + var canReName: String? = null ) : Parcelable \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/model/webBook/BookInfo.kt b/app/src/main/java/io/legado/app/model/webBook/BookInfo.kt index 1bda2e242..38fd6e3e0 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookInfo.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookInfo.kt @@ -34,7 +34,7 @@ object BookInfo { analyzeRule.setContent(analyzeRule.getElement(it)) } } - val mCanReName = canReName && infoRule.canReName == true + val mCanReName = canReName && !infoRule.canReName.isNullOrBlank() Debug.log(bookSource.bookSourceUrl, "┌获取书名") BookHelp.formatBookName(analyzeRule.getString(infoRule.name)).let { if (it.isNotEmpty() && (mCanReName || book.name.isEmpty())) { diff --git a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt index 21bbca811..78f65f6df 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt @@ -219,6 +219,7 @@ class BookSourceEditActivity : add(EditEntity("intro", ir?.intro, R.string.rule_book_intro)) add(EditEntity("coverUrl", ir?.coverUrl, R.string.rule_cover_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() @@ -324,6 +325,7 @@ class BookSourceEditActivity : "lastChapter" -> bookInfoRule.lastChapter = it.value "coverUrl" -> bookInfoRule.coverUrl = it.value "tocUrl" -> bookInfoRule.tocUrl = it.value + "canReName" -> bookInfoRule.canReName = it.value } } tocEntities.forEach { diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 86016deef..4e1ef3572 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -403,6 +403,7 @@ 書籍 URL 正則 (bookUrlPattern) 預處理規則 (bookInfoInit) 目錄 URL 規則 (tocUrl) + 允许修改书名作者(canReName) 目錄下一頁規則 (nextTocUrl) 目錄列表規則 (chapterList) 章節名稱規則 (ChapterName) diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 9397f9e6b..9ebde7629 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -404,6 +404,7 @@ 書籍URL正則(bookUrlPattern) 預處理規則(bookInfoInit) 目錄URL規則(tocUrl) + 允许修改书名作者(canReName) 目錄下一頁規則(nextTocUrl) 目錄列表規則(chapterList) 章節名稱規則(ChapterName) diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index bee8a136d..7171a3deb 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -409,6 +409,7 @@ 书籍URL正则(bookUrlPattern) 预处理规则(bookInfoInit) 目录URL规则(tocUrl) + 允许修改书名作者(canReName) 目录下一页规则(nextTocUrl) 目录列表规则(chapterList) 章节名称规则(ChapterName) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c0dc2bc30..bde2d6a79 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -411,6 +411,7 @@ 书籍URL正则(bookUrlPattern) 预处理规则(bookInfoInit) 目录URL规则(tocUrl) + 允许修改书名作者(canReName) 目录下一页规则(nextTocUrl) 目录列表规则(chapterList) 章节名称规则(ChapterName)