feat:添加文件类型书源(知轩藏书类)

pull/1874/head
Xwite 3 years ago
parent 08a3b95b43
commit 684fb199db
  1. 2
      app/src/main/assets/web/bookSource/index.html
  2. 3
      app/src/main/java/io/legado/app/constant/BookType.kt
  3. 2
      app/src/main/java/io/legado/app/data/entities/BookSource.kt
  4. 2
      app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt
  5. 1
      app/src/main/res/values-es-rES/arrays.xml
  6. 1
      app/src/main/res/values-pt-rBR/arrays.xml
  7. 1
      app/src/main/res/values-zh-rHK/arrays.xml
  8. 1
      app/src/main/res/values-zh-rTW/arrays.xml
  9. 1
      app/src/main/res/values-zh/arrays.xml
  10. 1
      app/src/main/res/values/arrays.xml

@ -25,7 +25,7 @@
<div> <div>
<div>源类型 :</div> <div>源类型 :</div>
<textarea rows="1" id="bookSourceType" class="base" title="bookSourceType" <textarea rows="1" id="bookSourceType" class="base" title="bookSourceType"
placeholder="&lt;必填&gt;0:文本 1:音频 2:图片"></textarea> placeholder="&lt;必填&gt;0:文本 1:音频 2:图片 3:文件(只提供下载的网站)"></textarea>
</div> </div>
<div> <div>
<div>源名称 :</div> <div>源名称 :</div>

@ -5,7 +5,8 @@ import androidx.annotation.IntDef
object BookType { object BookType {
const val default = 0 // 0 文本 const val default = 0 // 0 文本
const val audio = 1 // 1 音频 const val audio = 1 // 1 音频
const val image = 2 //图片 const val image = 2 // 2 图片
const val file = 3 // 3 只提供下载服务的网站
const val local = "loc_book" const val local = "loc_book"
@Target(AnnotationTarget.VALUE_PARAMETER) @Target(AnnotationTarget.VALUE_PARAMETER)

@ -27,7 +27,7 @@ data class BookSource(
var bookSourceName: String = "", var bookSourceName: String = "",
// 分组 // 分组
var bookSourceGroup: String? = null, var bookSourceGroup: String? = null,
// 类型,0 文本,1 音频, 2 图片 // 类型,0 文本,1 音频, 2 图片, 3 文件(指的是类似知轩藏书只提供下载的网站)
@BookType.Type @BookType.Type
var bookSourceType: Int = 0, var bookSourceType: Int = 0,
// 详情页url正则 // 详情页url正则

@ -192,6 +192,7 @@ class BookSourceEditActivity :
binding.cbIsEnableFind.isChecked = it.enabledExplore binding.cbIsEnableFind.isChecked = it.enabledExplore
binding.spType.setSelection( binding.spType.setSelection(
when (it.bookSourceType) { when (it.bookSourceType) {
BookType.file -> 3
BookType.image -> 2 BookType.image -> 2
BookType.audio -> 1 BookType.audio -> 1
else -> 0 else -> 0
@ -296,6 +297,7 @@ class BookSourceEditActivity :
source.enabled = binding.cbIsEnable.isChecked source.enabled = binding.cbIsEnable.isChecked
source.enabledExplore = binding.cbIsEnableFind.isChecked source.enabledExplore = binding.cbIsEnableFind.isChecked
source.bookSourceType = when (binding.spType.selectedItemPosition) { source.bookSourceType = when (binding.spType.selectedItemPosition) {
3 -> BookType.file
2 -> BookType.image 2 -> BookType.image
1 -> BookType.audio 1 -> BookType.audio
else -> BookType.default else -> BookType.default

@ -4,6 +4,7 @@
<item>Texto</item> <item>Texto</item>
<item>Audio</item> <item>Audio</item>
<item>Image</item> <item>Image</item>
<item>File</item>
</string-array> </string-array>
<string-array name="group_style"> <string-array name="group_style">

@ -4,6 +4,7 @@
<item>Texto</item> <item>Texto</item>
<item>Áudio</item> <item>Áudio</item>
<item>Image</item> <item>Image</item>
<item>File</item>
</string-array> </string-array>
<string-array name="group_style"> <string-array name="group_style">

@ -5,6 +5,7 @@
<item>文本</item> <item>文本</item>
<item>音頻</item> <item>音頻</item>
<item>图片</item> <item>图片</item>
<item>文件</item>
</string-array> </string-array>
<string-array name="group_style"> <string-array name="group_style">

@ -4,6 +4,7 @@
<item>文字</item> <item>文字</item>
<item>音訊</item> <item>音訊</item>
<item>图片</item> <item>图片</item>
<item>文件</item>
</string-array> </string-array>
<string-array name="group_style"> <string-array name="group_style">

@ -4,6 +4,7 @@
<item>文本</item> <item>文本</item>
<item>音频</item> <item>音频</item>
<item>图片</item> <item>图片</item>
<item>文件</item>
</string-array> </string-array>
<string-array name="group_style"> <string-array name="group_style">

@ -4,6 +4,7 @@
<item>Text</item> <item>Text</item>
<item>Audio</item> <item>Audio</item>
<item>Image</item> <item>Image</item>
<item>File</item>
</string-array> </string-array>
<string-array name="group_style"> <string-array name="group_style">

Loading…
Cancel
Save