Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
PublicAndroidApps
Nebulo
Commits
8feb4126
Commit
8feb4126
authored
Jul 28, 2020
by
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
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/com/frostnerd/smokescreen/database/dao/HostSourceDao.kt
View file @
8feb4126
...
...
@@ -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 DE
SC"
)
@Query
(
"SELECT * FROM HostSource WHERE enabled > 0 ORDER BY
name A
SC"
)
fun
getAllEnabled
():
List
<
HostSource
>
@Query
(
"SELECT COUNT(*) FROM HostSource"
)
...
...
app/src/main/java/com/frostnerd/smokescreen/service/RuleImportService.kt
View file @
8feb4126
...
...
@@ -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
()
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment