Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
44368383
Commit
44368383
authored
Jul 28, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix fetching repo ordering
parent
d1ff7e0f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
RepoDao.kt
...c/main/java/com/topjohnwu/magisk/data/database/RepoDao.kt
+9
-7
No files found.
app/src/main/java/com/topjohnwu/magisk/data/database/RepoDao.kt
View file @
44368383
...
...
@@ -9,11 +9,10 @@ abstract class RepoDao {
val
repoIDSet
:
Set
<
String
>
get
()
=
getRepoID
().
map
{
it
.
id
}.
toSet
()
val
repos
:
List
<
Repo
>
get
()
=
getReposWithOrder
(
when
(
Config
.
repoOrder
)
{
Config
.
Value
.
ORDER_NAME
->
"name COLLATE NOCASE"
Config
.
Value
.
ORDER_DATE
->
"last_update DESC"
else
->
""
})
val
repos
:
List
<
Repo
>
get
()
=
when
(
Config
.
repoOrder
)
{
Config
.
Value
.
ORDER_NAME
->
getReposNameOrder
()
else
->
getReposDateOrder
()
}
var
etagKey
:
String
set
(
etag
)
=
addEtagRaw
(
RepoEtag
(
0
,
etag
))
...
...
@@ -24,8 +23,11 @@ abstract class RepoDao {
clearEtag
()
}
@Query
(
"SELECT * FROM repos ORDER BY :order"
)
protected
abstract
fun
getReposWithOrder
(
order
:
String
):
List
<
Repo
>
@Query
(
"SELECT * FROM repos ORDER BY last_update DESC"
)
protected
abstract
fun
getReposDateOrder
():
List
<
Repo
>
@Query
(
"SELECT * FROM repos ORDER BY name COLLATE NOCASE"
)
protected
abstract
fun
getReposNameOrder
():
List
<
Repo
>
@Insert
(
onConflict
=
OnConflictStrategy
.
REPLACE
)
abstract
fun
addRepo
(
repo
:
Repo
)
...
...
Write
Preview
Markdown
is supported
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