Просмотр исходного кода

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

Xwite 4 лет назад
Родитель
Сommit
7437344a76

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

@@ -25,7 +25,7 @@
             <div>
                 <div>源类型 :</div>
                 <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>

+ 2 - 1
app/src/main/java/io/legado/app/constant/BookType.kt

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

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

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

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

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

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

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

+ 1 - 0
app/src/main/res/values-pt-rBR/arrays.xml

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

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

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

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

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

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

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

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

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