@ -14,30 +14,25 @@ interface BookSourceDao {
@Query ( " select * from book_sources where bookSourceName like :searchKey or bookSourceGroup like :searchKey or bookSourceUrl like :searchKey order by customOrder asc " )
@Query ( " select * from book_sources where bookSourceName like :searchKey or bookSourceGroup like :searchKey or bookSourceUrl like :searchKey order by customOrder asc " )
fun liveDataSearch ( searchKey : String = " " ) : LiveData < List < BookSource > >
fun liveDataSearch ( searchKey : String = " " ) : LiveData < List < BookSource > >
@Query ( " select * from book_sources where enabledExplore = 1 and exploreUrl is not null and exploreUrl <> '' order by customOrder asc " )
@Query ( " select * from book_sources where enabledExplore = 1 and trim(exploreUrl) <> '' order by customOrder asc " )
fun liveExplore ( ) : LiveData < List < BookSource > >
fun liveExplore ( ) : LiveData < List < BookSource > >
@Query (
@Query (
"""
"""
select * from book _sources
select * from book _sources
where enabledExplore = 1 and exploreUrl is not null and exploreUrl < > ' ' and ( bookSourceGroup like : key or bookSourceName like : key )
where enabledExplore = 1 and trim ( exploreUrl ) < > ' ' and ( bookSourceGroup like : key or bookSourceName like : key )
order by customOrder asc
order by customOrder asc
"""
"""
)
)
fun liveExplore ( key : String ) : LiveData < List < BookSource > >
fun liveExplore ( key : String ) : LiveData < List < BookSource > >
@Query ( " select bookSourceGroup from book_sources where bookSourceGroup is not null and bookSourceGroup <> '' " )
@Query ( " select bookSourceGroup from book_sources where trim(bookSourceGroup) <> '' " )
fun liveGroup ( ) : LiveData < List < String > >
fun liveGroup ( ) : LiveData < List < String > >
@Query ( " select bookSourceGroup from book_sources where enabled = 1 and bookSourceGroup is not null and bookSourceGroup <> '' " )
@Query ( " select bookSourceGroup from book_sources where enabled = 1 and trim(bookSourceGroup) <> '' " )
fun liveGroupEnabled ( ) : LiveData < List < String > >
fun liveGroupEnabled ( ) : LiveData < List < String > >
@Query (
@Query ( " select bookSourceGroup from book_sources where enabledExplore = 1 and trim(exploreUrl) <> '' and trim(bookSourceGroup) <> '' " )
"""
select bookSourceGroup from book _sources
where enabledExplore = 1 and exploreUrl is not null and exploreUrl < > ' ' and bookSourceGroup is not null and bookSourceGroup < > ' '
"""
)
fun liveGroupExplore ( ) : LiveData < List < String > >
fun liveGroupExplore ( ) : LiveData < List < String > >
@Query ( " select distinct enabled from book_sources where bookSourceName like :searchKey or bookSourceGroup like :searchKey or bookSourceUrl like :searchKey " )
@Query ( " select distinct enabled from book_sources where bookSourceName like :searchKey or bookSourceGroup like :searchKey or bookSourceUrl like :searchKey " )