|
@@ -96,14 +96,16 @@ interface BookSourceDao {
|
|
|
@Query(
|
|
@Query(
|
|
|
"""select bookSourceUrl, bookSourceName, bookSourceGroup, customOrder, enabled, enabledExplore,
|
|
"""select bookSourceUrl, bookSourceName, bookSourceGroup, customOrder, enabled, enabledExplore,
|
|
|
trim(loginUrl) <> '' hasLoginUrl, lastUpdateTime, respondTime, weight, trim(exploreUrl) <> '' hasExploreUrl
|
|
trim(loginUrl) <> '' hasLoginUrl, lastUpdateTime, respondTime, weight, trim(exploreUrl) <> '' hasExploreUrl
|
|
|
- from book_sources where loginUrl is not null and loginUrl != ''"""
|
|
|
|
|
|
|
+ from book_sources where loginUrl is not null and loginUrl != ''
|
|
|
|
|
+ order by customOrder asc"""
|
|
|
)
|
|
)
|
|
|
fun flowLogin(): Flow<List<BookSourcePart>>
|
|
fun flowLogin(): Flow<List<BookSourcePart>>
|
|
|
|
|
|
|
|
@Query(
|
|
@Query(
|
|
|
"""select bookSourceUrl, bookSourceName, bookSourceGroup, customOrder, enabled, enabledExplore,
|
|
"""select bookSourceUrl, bookSourceName, bookSourceGroup, customOrder, enabled, enabledExplore,
|
|
|
trim(loginUrl) <> '' hasLoginUrl, lastUpdateTime, respondTime, weight, trim(exploreUrl) <> '' hasExploreUrl
|
|
trim(loginUrl) <> '' hasLoginUrl, lastUpdateTime, respondTime, weight, trim(exploreUrl) <> '' hasExploreUrl
|
|
|
- from book_sources where bookSourceGroup is null or bookSourceGroup = '' or bookSourceGroup like '%未分组%'"""
|
|
|
|
|
|
|
+ from book_sources where bookSourceGroup is null or bookSourceGroup = '' or bookSourceGroup like '%未分组%'
|
|
|
|
|
+ order by customOrder asc"""
|
|
|
)
|
|
)
|
|
|
fun flowNoGroup(): Flow<List<BookSourcePart>>
|
|
fun flowNoGroup(): Flow<List<BookSourcePart>>
|
|
|
|
|
|
|
@@ -144,7 +146,7 @@ interface BookSourceDao {
|
|
|
)
|
|
)
|
|
|
fun flowExploreGroupsUnProcessed(): Flow<List<String>>
|
|
fun flowExploreGroupsUnProcessed(): Flow<List<String>>
|
|
|
|
|
|
|
|
- @Query("select * from book_sources where bookSourceGroup like '%' || :group || '%'")
|
|
|
|
|
|
|
+ @Query("select * from book_sources where bookSourceGroup like '%' || :group || '%' order by customOrder asc")
|
|
|
fun getByGroup(group: String): List<BookSource>
|
|
fun getByGroup(group: String): List<BookSource>
|
|
|
|
|
|
|
|
@Query(
|
|
@Query(
|
|
@@ -153,11 +155,12 @@ interface BookSourceDao {
|
|
|
and (bookSourceGroup = :group
|
|
and (bookSourceGroup = :group
|
|
|
or bookSourceGroup like :group || ',%'
|
|
or bookSourceGroup like :group || ',%'
|
|
|
or bookSourceGroup like '%,' || :group
|
|
or bookSourceGroup like '%,' || :group
|
|
|
- or bookSourceGroup like '%,' || :group || ',%')"""
|
|
|
|
|
|
|
+ or bookSourceGroup like '%,' || :group || ',%')
|
|
|
|
|
+ order by customOrder asc"""
|
|
|
)
|
|
)
|
|
|
fun getEnabledByGroup(group: String): List<BookSource>
|
|
fun getEnabledByGroup(group: String): List<BookSource>
|
|
|
|
|
|
|
|
- @Query("select * from book_sources where bookUrlPattern != 'NONE' and bookSourceType = :type")
|
|
|
|
|
|
|
+ @Query("select * from book_sources where bookUrlPattern != 'NONE' and bookSourceType = :type order by customOrder asc")
|
|
|
fun getEnabledByType(type: Int): List<BookSource>
|
|
fun getEnabledByType(type: Int): List<BookSource>
|
|
|
|
|
|
|
|
@Query("select * from book_sources where enabled = 1 and bookSourceUrl = :baseUrl")
|
|
@Query("select * from book_sources where enabled = 1 and bookSourceUrl = :baseUrl")
|