mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-06 12:37:26 +00:00
Restored entries selection restoration =)
This commit is contained in:
1 parent
63a759e499
commit
0ef2a09e8a
2 files changed
+7
No files matched your search
@@ -62,7 +62,9 @@ class DefaultRepository @Inject constructor(
|
|||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
resolver.openInputStream(fileUri)?.use { stream ->
|
resolver.openInputStream(fileUri)?.use { stream ->
|
||||||
val importedEntries = TLE.importSat(stream).map { SatEntry(it) }
|
val importedEntries = TLE.importSat(stream).map { SatEntry(it) }
|
||||||
|
val selection = entriesDao.getEntriesSelection()
|
||||||
entriesDao.updateEntries(importedEntries)
|
entriesDao.updateEntries(importedEntries)
|
||||||
|
entriesDao.updateEntriesSelection(selection)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,7 +82,9 @@ class DefaultRepository @Inject constructor(
|
|||||||
val entries = TLE.importSat(stream).map { tle -> SatEntry(tle) }
|
val entries = TLE.importSat(stream).map { tle -> SatEntry(tle) }
|
||||||
importedEntries.addAll(entries)
|
importedEntries.addAll(entries)
|
||||||
}
|
}
|
||||||
|
val selection = entriesDao.getEntriesSelection()
|
||||||
entriesDao.updateEntries(importedEntries)
|
entriesDao.updateEntries(importedEntries)
|
||||||
|
entriesDao.updateEntriesSelection(selection)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ interface EntriesDao {
|
|||||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||||
suspend fun insertEntries(entries: List<SatEntry>)
|
suspend fun insertEntries(entries: List<SatEntry>)
|
||||||
|
|
||||||
|
@Query("SELECT catNum FROM entries WHERE isSelected = 1")
|
||||||
|
suspend fun getEntriesSelection(): List<Int>
|
||||||
|
|
||||||
@Transaction
|
@Transaction
|
||||||
suspend fun updateEntriesSelection(satIds: List<Int>) {
|
suspend fun updateEntriesSelection(satIds: List<Int>) {
|
||||||
clearSelection()
|
clearSelection()
|
||||||
|
|||||||
Reference in new issue
Block a user