mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
Merge pull request #3456 from okou19900722/feature/3454
书源管理界面添加筛选方式--是否开启发现。 resolved #3454
This commit is contained in:
commit
f04670dc88
@ -111,6 +111,20 @@ interface BookSourceDao {
|
|||||||
)
|
)
|
||||||
fun flowNoGroup(): Flow<List<BookSourcePart>>
|
fun flowNoGroup(): Flow<List<BookSourcePart>>
|
||||||
|
|
||||||
|
@Query(
|
||||||
|
"""select bookSourceUrl, bookSourceName, bookSourceGroup, customOrder, enabled, enabledExplore,
|
||||||
|
trim(loginUrl) <> '' hasLoginUrl, lastUpdateTime, respondTime, weight, trim(exploreUrl) <> '' hasExploreUrl
|
||||||
|
from book_sources where enabledExplore = 1 order by customOrder asc"""
|
||||||
|
)
|
||||||
|
fun flowEnabledExplore(): Flow<List<BookSourcePart>>
|
||||||
|
|
||||||
|
@Query(
|
||||||
|
"""select bookSourceUrl, bookSourceName, bookSourceGroup, customOrder, enabled, enabledExplore,
|
||||||
|
trim(loginUrl) <> '' hasLoginUrl, lastUpdateTime, respondTime, weight, trim(exploreUrl) <> '' hasExploreUrl
|
||||||
|
from book_sources where enabledExplore = 0 order by customOrder asc"""
|
||||||
|
)
|
||||||
|
fun flowDisabledExplore(): Flow<List<BookSourcePart>>
|
||||||
|
|
||||||
@Query(
|
@Query(
|
||||||
"""select * from book_sources
|
"""select * from book_sources
|
||||||
where enabledExplore = 1
|
where enabledExplore = 1
|
||||||
@ -193,6 +207,12 @@ interface BookSourceDao {
|
|||||||
@get:Query("select * from book_sources where bookSourceGroup is null or bookSourceGroup = '' or bookSourceGroup like '%未分组%'")
|
@get:Query("select * from book_sources where bookSourceGroup is null or bookSourceGroup = '' or bookSourceGroup like '%未分组%'")
|
||||||
val allNoGroup: List<BookSource>
|
val allNoGroup: List<BookSource>
|
||||||
|
|
||||||
|
@get:Query("select * from book_sources where enabledExplore = 1 order by customOrder")
|
||||||
|
val allEnabledExplore: List<BookSource>
|
||||||
|
|
||||||
|
@get:Query("select * from book_sources where enabledExplore = 0 order by customOrder")
|
||||||
|
val allDisabledExplore: List<BookSource>
|
||||||
|
|
||||||
@get:Query("select * from book_sources where loginUrl is not null and loginUrl != ''")
|
@get:Query("select * from book_sources where loginUrl is not null and loginUrl != ''")
|
||||||
val allLogin: List<BookSource>
|
val allLogin: List<BookSource>
|
||||||
|
|
||||||
|
@ -217,6 +217,14 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
|
|||||||
searchView.setQuery(getString(R.string.no_group), true)
|
searchView.setQuery(getString(R.string.no_group), true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
R.id.menu_enabled_explore_group -> {
|
||||||
|
searchView.setQuery(getString(R.string.enabled_explore), true)
|
||||||
|
}
|
||||||
|
|
||||||
|
R.id.menu_disabled_explore_group -> {
|
||||||
|
searchView.setQuery(getString(R.string.disabled_explore), true)
|
||||||
|
}
|
||||||
|
|
||||||
R.id.menu_help -> showHelp()
|
R.id.menu_help -> showHelp()
|
||||||
}
|
}
|
||||||
if (item.groupId == R.id.source_group) {
|
if (item.groupId == R.id.source_group) {
|
||||||
@ -272,6 +280,14 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
|
|||||||
appDb.bookSourceDao.flowNoGroup()
|
appDb.bookSourceDao.flowNoGroup()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
searchKey == getString(R.string.enabled_explore) -> {
|
||||||
|
appDb.bookSourceDao.flowEnabledExplore()
|
||||||
|
}
|
||||||
|
|
||||||
|
searchKey == getString(R.string.disabled_explore) -> {
|
||||||
|
appDb.bookSourceDao.flowDisabledExplore()
|
||||||
|
}
|
||||||
|
|
||||||
searchKey.startsWith("group:") -> {
|
searchKey.startsWith("group:") -> {
|
||||||
val key = searchKey.substringAfter("group:")
|
val key = searchKey.substringAfter("group:")
|
||||||
appDb.bookSourceDao.flowGroupSearch(key)
|
appDb.bookSourceDao.flowGroupSearch(key)
|
||||||
|
@ -191,6 +191,14 @@ class BookSourceViewModel(application: Application) : BaseViewModel(application)
|
|||||||
appDb.bookSourceDao.allNoGroup
|
appDb.bookSourceDao.allNoGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
|
searchKey == appCtx.getString(R.string.enabled_explore) -> {
|
||||||
|
appDb.bookSourceDao.allEnabledExplore
|
||||||
|
}
|
||||||
|
|
||||||
|
searchKey == appCtx.getString(R.string.disabled_explore) -> {
|
||||||
|
appDb.bookSourceDao.allDisabledExplore
|
||||||
|
}
|
||||||
|
|
||||||
searchKey.startsWith("group:") -> {
|
searchKey.startsWith("group:") -> {
|
||||||
val key = searchKey.substringAfter("group:")
|
val key = searchKey.substringAfter("group:")
|
||||||
appDb.bookSourceDao.groupSearch(key)
|
appDb.bookSourceDao.groupSearch(key)
|
||||||
|
@ -92,6 +92,14 @@
|
|||||||
android:id="@+id/menu_group_null"
|
android:id="@+id/menu_group_null"
|
||||||
android:title="@string/no_group" />
|
android:title="@string/no_group" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/menu_enabled_explore_group"
|
||||||
|
android:title="@string/enabled_explore" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/menu_disabled_explore_group"
|
||||||
|
android:title="@string/disabled_explore" />
|
||||||
|
|
||||||
<group android:id="@+id/source_group">
|
<group android:id="@+id/source_group">
|
||||||
|
|
||||||
</group>
|
</group>
|
||||||
|
@ -729,6 +729,8 @@
|
|||||||
<string name="import_old_summary">Seleccione una carpeta de respaldo heredada</string>
|
<string name="import_old_summary">Seleccione una carpeta de respaldo heredada</string>
|
||||||
<string name="enabled">Activado</string>
|
<string name="enabled">Activado</string>
|
||||||
<string name="disabled">Desactivado</string>
|
<string name="disabled">Desactivado</string>
|
||||||
|
<string name="enabled_explore">Discovery Enabled</string>
|
||||||
|
<string name="disabled_explore">Discovery Disabled</string>
|
||||||
<string name="starting_download">Iniciando descarga</string>
|
<string name="starting_download">Iniciando descarga</string>
|
||||||
<string name="already_in_download">Este libro ya está en la lista de descargas</string>
|
<string name="already_in_download">Este libro ya está en la lista de descargas</string>
|
||||||
<string name="click_to_open">Haga clic para abrir</string>
|
<string name="click_to_open">Haga clic para abrir</string>
|
||||||
|
@ -732,6 +732,8 @@
|
|||||||
<string name="import_old_summary">Select a legacy backup folder</string>
|
<string name="import_old_summary">Select a legacy backup folder</string>
|
||||||
<string name="enabled">Enabled</string>
|
<string name="enabled">Enabled</string>
|
||||||
<string name="disabled">Disabled</string>
|
<string name="disabled">Disabled</string>
|
||||||
|
<string name="enabled_explore">Discovery Enabled</string>
|
||||||
|
<string name="disabled_explore">Discovery Disabled</string>
|
||||||
<string name="starting_download">Starting download</string>
|
<string name="starting_download">Starting download</string>
|
||||||
<string name="already_in_download">This book is already in Download list</string>
|
<string name="already_in_download">This book is already in Download list</string>
|
||||||
<string name="click_to_open">Click to open</string>
|
<string name="click_to_open">Click to open</string>
|
||||||
|
@ -730,6 +730,8 @@
|
|||||||
<string name="import_old_summary">Selecione uma pasta Legado de Backup</string>
|
<string name="import_old_summary">Selecione uma pasta Legado de Backup</string>
|
||||||
<string name="enabled">Ativado</string>
|
<string name="enabled">Ativado</string>
|
||||||
<string name="disabled">Desativado</string>
|
<string name="disabled">Desativado</string>
|
||||||
|
<string name="enabled_explore">Discovery Enabled</string>
|
||||||
|
<string name="disabled_explore">Discovery Disabled</string>
|
||||||
<string name="starting_download">Iniciando o download</string>
|
<string name="starting_download">Iniciando o download</string>
|
||||||
<string name="already_in_download">Este livro já está na lista de download</string>
|
<string name="already_in_download">Este livro já está na lista de download</string>
|
||||||
<string name="click_to_open">Clique para abrir</string>
|
<string name="click_to_open">Clique para abrir</string>
|
||||||
|
@ -730,6 +730,8 @@ Còn </string>
|
|||||||
<string name="import_old_summary">Chọn thư mục sao lưu kế thừa</string>
|
<string name="import_old_summary">Chọn thư mục sao lưu kế thừa</string>
|
||||||
<string name="enabled">Đã bật</string>
|
<string name="enabled">Đã bật</string>
|
||||||
<string name="disabled">Đã tắt</string>
|
<string name="disabled">Đã tắt</string>
|
||||||
|
<string name="enabled_explore">Discovery Enabled</string>
|
||||||
|
<string name="disabled_explore">Discovery Disabled</string>
|
||||||
<string name="starting_download">Bắt đầu tải xuống</string>
|
<string name="starting_download">Bắt đầu tải xuống</string>
|
||||||
<string name="already_in_download">Cuốn sách này đã có trong danh sách Download</string>
|
<string name="already_in_download">Cuốn sách này đã có trong danh sách Download</string>
|
||||||
<string name="click_to_open">Nhấp để mở</string>
|
<string name="click_to_open">Nhấp để mở</string>
|
||||||
|
@ -723,6 +723,8 @@
|
|||||||
<string name="import_old_summary">選擇舊版備份文件夾</string>
|
<string name="import_old_summary">選擇舊版備份文件夾</string>
|
||||||
<string name="enabled">已啓用</string>
|
<string name="enabled">已啓用</string>
|
||||||
<string name="disabled">已禁用</string>
|
<string name="disabled">已禁用</string>
|
||||||
|
<string name="enabled_explore">已啟用發現</string>
|
||||||
|
<string name="disabled_explore">已禁用發現</string>
|
||||||
<string name="text_bottom_justify">文字底部對齊</string>
|
<string name="text_bottom_justify">文字底部對齊</string>
|
||||||
<string name="starting_download">正在啟動下載</string>
|
<string name="starting_download">正在啟動下載</string>
|
||||||
<string name="already_in_download">該書已在下載列表</string>
|
<string name="already_in_download">該書已在下載列表</string>
|
||||||
|
@ -731,6 +731,8 @@
|
|||||||
<string name="import_old_summary">選擇舊版備份資料夾</string>
|
<string name="import_old_summary">選擇舊版備份資料夾</string>
|
||||||
<string name="enabled">已啟用</string>
|
<string name="enabled">已啟用</string>
|
||||||
<string name="disabled">已禁用</string>
|
<string name="disabled">已禁用</string>
|
||||||
|
<string name="enabled_explore">已啟用發現</string>
|
||||||
|
<string name="disabled_explore">已禁用發現</string>
|
||||||
<string name="starting_download">正在啟動下載</string>
|
<string name="starting_download">正在啟動下載</string>
|
||||||
<string name="already_in_download">該書已在下載列表</string>
|
<string name="already_in_download">該書已在下載列表</string>
|
||||||
<string name="click_to_open">點擊打開</string>
|
<string name="click_to_open">點擊打開</string>
|
||||||
|
@ -732,6 +732,8 @@
|
|||||||
<string name="import_old_summary">选择旧版备份文件夹</string>
|
<string name="import_old_summary">选择旧版备份文件夹</string>
|
||||||
<string name="enabled">已启用</string>
|
<string name="enabled">已启用</string>
|
||||||
<string name="disabled">已禁用</string>
|
<string name="disabled">已禁用</string>
|
||||||
|
<string name="enabled_explore">已启用发现</string>
|
||||||
|
<string name="disabled_explore">已禁用发现</string>
|
||||||
<string name="starting_download">正在启动下载</string>
|
<string name="starting_download">正在启动下载</string>
|
||||||
<string name="already_in_download">该书已在下载列表</string>
|
<string name="already_in_download">该书已在下载列表</string>
|
||||||
<string name="click_to_open">点击打开</string>
|
<string name="click_to_open">点击打开</string>
|
||||||
|
@ -734,6 +734,8 @@
|
|||||||
<string name="import_old_summary">Select a legacy backup folder</string>
|
<string name="import_old_summary">Select a legacy backup folder</string>
|
||||||
<string name="enabled">Enabled</string>
|
<string name="enabled">Enabled</string>
|
||||||
<string name="disabled">Disabled</string>
|
<string name="disabled">Disabled</string>
|
||||||
|
<string name="enabled_explore">Discovery Enabled</string>
|
||||||
|
<string name="disabled_explore">Discovery Disabled</string>
|
||||||
<string name="starting_download">Starting download</string>
|
<string name="starting_download">Starting download</string>
|
||||||
<string name="already_in_download">This book is already in Download list</string>
|
<string name="already_in_download">This book is already in Download list</string>
|
||||||
<string name="click_to_open">Click to open</string>
|
<string name="click_to_open">Click to open</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user