Commit 8feb4126 authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Order host sources by name (so that the sources first in the list contain the least duplicates)

parent 8280f21f
Pipeline #7306 passed with stage
in 3 minutes and 56 seconds
......@@ -48,7 +48,7 @@ interface HostSourceDao {
@Query("SELECT * FROM HostSource ORDER BY name COLLATE NOCASE ASC")
fun getAll(): List<HostSource>
@Query("SELECT * FROM HostSource WHERE enabled > 0 ORDER BY whitelistSource DESC")
@Query("SELECT * FROM HostSource WHERE enabled > 0 ORDER BY name ASC")
fun getAllEnabled(): List<HostSource>
@Query("SELECT COUNT(*) FROM HostSource")
......
......@@ -97,9 +97,7 @@ class RuleImportService : IntentService("RuleImportService") {
getDatabase().hostSourceDao().getAllEnabled().filter {
it.id in ids
}
} ?: getDatabase().hostSourceDao().getAllEnabled()).sortedByDescending {
it.whitelistSource // Process whitelist first
}
} ?: getDatabase().hostSourceDao().getAllEnabled()).sortedWith(compareBy({it.whitelistSource}, {it.name}))
sourcesIds = sources.map { it.id }
startWork()
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment