pull/35/head^2
kunfei 5 years ago
parent d4164d89e1
commit 63c1b8914e
  1. 4
      app/src/main/java/io/legado/app/data/dao/RssSourceDao.kt
  2. 3
      app/src/main/java/io/legado/app/data/entities/RssSource.kt

@ -13,10 +13,10 @@ interface RssSourceDao {
@get:Query("SELECT * FROM rssSources") @get:Query("SELECT * FROM rssSources")
val all: List<RssSource> val all: List<RssSource>
@Query("SELECT * FROM rssSources") @Query("SELECT * FROM rssSources order by customOrder")
fun liveAll(): LiveData<List<RssSource>> fun liveAll(): LiveData<List<RssSource>>
@Query("SELECT * FROM rssSources where sourceName like :key or sourceUrl like :key or sourceGroup like :key") @Query("SELECT * FROM rssSources where sourceName like :key or sourceUrl like :key or sourceGroup like :key order by customOrder")
fun liveSearch(key: String): LiveData<List<RssSource>> fun liveSearch(key: String): LiveData<List<RssSource>>
@Query("SELECT * FROM rssSources where enabled = 1") @Query("SELECT * FROM rssSources where enabled = 1")

@ -2,11 +2,12 @@ package io.legado.app.data.entities
import android.os.Parcelable import android.os.Parcelable
import androidx.room.Entity import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey import androidx.room.PrimaryKey
import kotlinx.android.parcel.Parcelize import kotlinx.android.parcel.Parcelize
@Parcelize @Parcelize
@Entity(tableName = "rssSources") @Entity(tableName = "rssSources", indices = [(Index(value = ["sourceUrl"], unique = false))])
data class RssSource( data class RssSource(
@PrimaryKey @PrimaryKey
var sourceUrl: String = "", var sourceUrl: String = "",

Loading…
Cancel
Save