mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
feat(ui):书源编辑添加自动保存cookie的选项(功能未实现)
This commit is contained in:
@@ -20,7 +20,7 @@ val appDb by lazy {
|
||||
}
|
||||
|
||||
@Database(
|
||||
version = 48,
|
||||
version = 49,
|
||||
exportSchema = true,
|
||||
entities = [Book::class, BookGroup::class, BookSource::class, BookChapter::class,
|
||||
ReplaceRule::class, SearchBook::class, SearchKeyword::class, Cookie::class,
|
||||
@@ -32,7 +32,8 @@ val appDb by lazy {
|
||||
AutoMigration(from = 44, to = 45),
|
||||
AutoMigration(from = 45, to = 46),
|
||||
AutoMigration(from = 46, to = 47),
|
||||
AutoMigration(from = 47, to = 48)
|
||||
AutoMigration(from = 47, to = 48),
|
||||
AutoMigration(from = 48, to = 49)
|
||||
]
|
||||
)
|
||||
abstract class AppDatabase : RoomDatabase() {
|
||||
|
||||
@@ -38,6 +38,9 @@ data class BookSource(
|
||||
var enabled: Boolean = true,
|
||||
// 启用发现
|
||||
var enabledExplore: Boolean = true,
|
||||
// 启用okhttp CookieJAr 自动保存每次请求的cookie
|
||||
@ColumnInfo(defaultValue = "0")
|
||||
var enabledCookieJar: Boolean = false,
|
||||
// 并发率
|
||||
override var concurrentRate: String? = null,
|
||||
// 请求头
|
||||
|
||||
@@ -190,6 +190,7 @@ class BookSourceEditActivity :
|
||||
source?.let {
|
||||
binding.cbIsEnable.isChecked = it.enabled
|
||||
binding.cbIsEnableFind.isChecked = it.enabledExplore
|
||||
binding.cbIsEnableCookie.isChecked = it.enabledCookieJar
|
||||
binding.spType.setSelection(
|
||||
when (it.bookSourceType) {
|
||||
BookType.file -> 3
|
||||
@@ -296,6 +297,7 @@ class BookSourceEditActivity :
|
||||
val source = viewModel.bookSource?.copy() ?: BookSource()
|
||||
source.enabled = binding.cbIsEnable.isChecked
|
||||
source.enabledExplore = binding.cbIsEnableFind.isChecked
|
||||
source.enabledCookieJar = binding.cbIsEnableCookie.isChecked
|
||||
source.bookSourceType = when (binding.spType.selectedItemPosition) {
|
||||
3 -> BookType.file
|
||||
2 -> BookType.image
|
||||
|
||||
@@ -33,6 +33,13 @@
|
||||
android:checked="true"
|
||||
android:text="@string/discovery" />
|
||||
|
||||
<io.legado.app.lib.theme.view.ThemeCheckBox
|
||||
android:id="@+id/cb_is_enable_cookie"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="@string/auto_save_cookie" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -978,5 +978,6 @@
|
||||
<string name="import_tts">导入TTS</string>
|
||||
<string name="import_theme">导入主题</string>
|
||||
<string name="import_txt_toc_rule">导入txt目录规则</string>
|
||||
<string name="auto_save_cookie">自动保存cookie</string>
|
||||
<!-- string end -->
|
||||
</resources>
|
||||
|
||||
@@ -981,5 +981,6 @@
|
||||
<string name="import_tts">导入TTS</string>
|
||||
<string name="import_theme">导入主题</string>
|
||||
<string name="import_txt_toc_rule">导入txt目录规则</string>
|
||||
<string name="auto_save_cookie">自动保存cookie</string>
|
||||
<!-- string end -->
|
||||
</resources>
|
||||
|
||||
@@ -981,5 +981,6 @@
|
||||
<string name="import_tts">导入TTS</string>
|
||||
<string name="import_theme">导入主题</string>
|
||||
<string name="import_txt_toc_rule">导入txt目录规则</string>
|
||||
<string name="auto_save_cookie">自动保存cookie</string>
|
||||
<!-- string end -->
|
||||
</resources>
|
||||
|
||||
@@ -978,5 +978,6 @@
|
||||
<string name="import_tts">导入TTS</string>
|
||||
<string name="import_theme">导入主题</string>
|
||||
<string name="import_txt_toc_rule">导入txt目录规则</string>
|
||||
<string name="auto_save_cookie">自动保存cookie</string>
|
||||
<!-- string end -->
|
||||
</resources>
|
||||
|
||||
@@ -980,5 +980,6 @@
|
||||
<string name="import_tts">导入TTS</string>
|
||||
<string name="import_theme">导入主题</string>
|
||||
<string name="import_txt_toc_rule">导入txt目录规则</string>
|
||||
<string name="auto_save_cookie">自动保存cookie</string>
|
||||
<!-- string end -->
|
||||
</resources>
|
||||
|
||||
@@ -980,5 +980,6 @@
|
||||
<string name="import_tts">导入TTS</string>
|
||||
<string name="import_theme">导入主题</string>
|
||||
<string name="import_txt_toc_rule">导入txt目录规则</string>
|
||||
<string name="auto_save_cookie">自动保存cookie</string>
|
||||
<!-- string end -->
|
||||
</resources>
|
||||
|
||||
@@ -981,5 +981,6 @@
|
||||
<string name="import_tts">导入TTS</string>
|
||||
<string name="import_theme">导入主题</string>
|
||||
<string name="import_txt_toc_rule">导入txt目录规则</string>
|
||||
<string name="auto_save_cookie">自动保存cookie</string>
|
||||
<!-- string end -->
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user