pull/1296/head
gedoor 3 years ago
parent c5ae3b5cd9
commit 848e8fb9c3
  1. 2
      app/src/main/java/io/legado/app/data/AppDatabase.kt
  2. 11
      app/src/main/java/io/legado/app/data/DatabaseMigrations.kt
  3. 5
      app/src/main/java/io/legado/app/data/entities/BaseSource.kt
  4. 4
      app/src/main/java/io/legado/app/data/entities/BookSource.kt
  5. 5
      app/src/main/java/io/legado/app/data/entities/RssSource.kt
  6. 1
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt

@ -16,7 +16,7 @@ val appDb by lazy {
} }
@Database( @Database(
version = 38, version = 39,
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,

@ -34,7 +34,8 @@ object DatabaseMigrations {
migration_34_35, migration_34_35,
migration_35_36, migration_35_36,
migration_36_37, migration_36_37,
migration_37_38 migration_37_38,
migration_38_39
) )
} }
@ -294,7 +295,7 @@ object DatabaseMigrations {
override fun migrate(database: SupportSQLiteDatabase) { override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("ALTER TABLE `rssSources` ADD `loginUrl` TEXT") database.execSQL("ALTER TABLE `rssSources` ADD `loginUrl` TEXT")
database.execSQL("ALTER TABLE `rssSources` ADD `loginUi` TEXT") database.execSQL("ALTER TABLE `rssSources` ADD `loginUi` TEXT")
database.execSQL("ALTER TABLE `rssSources` ADD`loginCheckJs` TEXT") database.execSQL("ALTER TABLE `rssSources` ADD `loginCheckJs` TEXT")
} }
} }
@ -303,4 +304,10 @@ object DatabaseMigrations {
database.execSQL("ALTER TABLE `book_sources` ADD `respondTime` INTEGER NOT NULL DEFAULT 180000") database.execSQL("ALTER TABLE `book_sources` ADD `respondTime` INTEGER NOT NULL DEFAULT 180000")
} }
} }
private val migration_38_39 = object : Migration(38, 39) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("ALTER TABLE `rssSources` ADD `concurrentRate` TEXT")
}
}
} }

@ -17,8 +17,9 @@ import javax.script.SimpleBindings
@Suppress("unused") @Suppress("unused")
interface BaseSource : JsExtensions { interface BaseSource : JsExtensions {
var loginUrl: String? var concurrentRate: String? // 并发率
var header: String? var loginUrl: String? // 登录地址
var header: String? // 请求头
fun getStoreUrl(): String fun getStoreUrl(): String

@ -23,12 +23,12 @@ data class BookSource(
var bookSourceUrl: String = "", // 地址,包括 http/https var bookSourceUrl: String = "", // 地址,包括 http/https
var bookSourceType: Int = BookType.default, // 类型,0 文本,1 音频, 3 图片 var bookSourceType: Int = BookType.default, // 类型,0 文本,1 音频, 3 图片
var bookUrlPattern: String? = null, // 详情页url正则 var bookUrlPattern: String? = null, // 详情页url正则
var concurrentRate: String? = null, //并发率
var customOrder: Int = 0, // 手动排序编号 var customOrder: Int = 0, // 手动排序编号
var enabled: Boolean = true, // 是否启用 var enabled: Boolean = true, // 是否启用
var enabledExplore: Boolean = true, // 启用发现 var enabledExplore: Boolean = true, // 启用发现
override var concurrentRate: String? = null, //并发率
override var header: String? = null, // 请求头 override var header: String? = null, // 请求头
override var loginUrl: String? = null, // 登录地址 override var loginUrl: String? = null, // 登录地址
var loginUi: List<RowUi>? = null, //登录UI var loginUi: List<RowUi>? = null, //登录UI
var loginCheckJs: String? = null, //登录检测js var loginCheckJs: String? = null, //登录检测js
var bookSourceComment: String? = null, // 注释 var bookSourceComment: String? = null, // 注释

@ -20,9 +20,10 @@ data class RssSource(
var sourceGroup: String? = null, var sourceGroup: String? = null,
var sourceComment: String? = null, var sourceComment: String? = null,
var enabled: Boolean = true, var enabled: Boolean = true,
override var concurrentRate: String? = null, //并发率
override var header: String? = null, // 请求头 override var header: String? = null, // 请求头
override var loginUrl: String? = null, // 登录地址 override var loginUrl: String? = null, // 登录地址
var loginUi: List<RowUi>? = null, //登录UI var loginUi: List<RowUi>? = null, //登录UI
var loginCheckJs: String? = null, //登录检测js var loginCheckJs: String? = null, //登录检测js
var sortUrl: String? = null, var sortUrl: String? = null,
var singleUrl: Boolean = false, var singleUrl: Boolean = false,

@ -270,6 +270,7 @@ class AnalyzeUrl(
if (type != null) { if (type != null) {
return StrResponse(url, StringUtils.byteToHexString(getByteArray())) return StrResponse(url, StringUtils.byteToHexString(getByteArray()))
} }
setCookie(source?.getStoreUrl()) setCookie(source?.getStoreUrl())
if (useWebView) { if (useWebView) {
val params = AjaxWebView.AjaxParams(url) val params = AjaxWebView.AjaxParams(url)

Loading…
Cancel
Save