mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
dcf6e6680a
commit
d193b6fcc9
@ -56,10 +56,10 @@ class BookSourceViewModel(application: Application) : BaseViewModel(application)
|
||||
if (items.isEmpty()) return
|
||||
execute {
|
||||
val firstSortNumber = items[0].customOrder
|
||||
items.forEachIndexed { index, bookSource ->
|
||||
bookSource.customOrder = firstSortNumber + index
|
||||
val array = items.mapIndexed { index, bookSource ->
|
||||
bookSource.copy(customOrder = firstSortNumber + index)
|
||||
}
|
||||
appDb.bookSourceDao.upOrder(items)
|
||||
appDb.bookSourceDao.upOrder(array)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user