From 63c1b8914ef24318208ca3ad87ab835463bbe3ea Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 3 Oct 2019 11:52:24 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/data/dao/RssSourceDao.kt | 4 ++-- app/src/main/java/io/legado/app/data/entities/RssSource.kt | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/data/dao/RssSourceDao.kt b/app/src/main/java/io/legado/app/data/dao/RssSourceDao.kt index d30b861da..8081068ed 100644 --- a/app/src/main/java/io/legado/app/data/dao/RssSourceDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/RssSourceDao.kt @@ -13,10 +13,10 @@ interface RssSourceDao { @get:Query("SELECT * FROM rssSources") val all: List - @Query("SELECT * FROM rssSources") + @Query("SELECT * FROM rssSources order by customOrder") fun liveAll(): LiveData> - @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> @Query("SELECT * FROM rssSources where enabled = 1") diff --git a/app/src/main/java/io/legado/app/data/entities/RssSource.kt b/app/src/main/java/io/legado/app/data/entities/RssSource.kt index 4537747a1..82f0d4863 100644 --- a/app/src/main/java/io/legado/app/data/entities/RssSource.kt +++ b/app/src/main/java/io/legado/app/data/entities/RssSource.kt @@ -2,11 +2,12 @@ package io.legado.app.data.entities import android.os.Parcelable import androidx.room.Entity +import androidx.room.Index import androidx.room.PrimaryKey import kotlinx.android.parcel.Parcelize @Parcelize -@Entity(tableName = "rssSources") +@Entity(tableName = "rssSources", indices = [(Index(value = ["sourceUrl"], unique = false))]) data class RssSource( @PrimaryKey var sourceUrl: String = "",