Reverted TLE source update screen, fixed location setting bug #53 #54

This commit is contained in:
Arty Bishop committed 2021-05-18 10:24:26 +01:00
1 parent fb2008b07a
commit a0a95ce372
26 files changed
+404 -78

No files matched your search

@@ -52,4 +52,10 @@ interface PreferencesSource {
fun loadModesSelection(): List<String>
fun getRotatorServer(): Pair<String, Int>?
fun loadTleSources(): List<String>
fun saveTleSources(sources: List<String>)
fun loadDefaultSources(): List<String>
}
@@ -35,12 +35,6 @@ class SatDataRepository(
private val satRemoteSource: SatDataRemoteSource,
private val ioDispatcher: CoroutineDispatcher
) {
private val defaultSources = listOf(
"https://celestrak.com/NORAD/elements/active.txt",
"https://amsat.org/tle/current/nasabare.txt",
"https://www.prismnet.com/~mmccants/tles/classfd.zip",
"https://www.prismnet.com/~mmccants/tles/inttles.zip"
)
fun saveSelectedModes(modes: List<String>) {
preferencesSource.saveModesSelection(modes)
@@ -66,7 +60,7 @@ class SatDataRepository(
satLocalSource.updateEntries(importSatEntries(stream))
}
suspend fun updateEntriesFromWeb(sources: List<String> = defaultSources) {
suspend fun updateEntriesFromWeb(sources: List<String>) {
coroutineScope {
launch(ioDispatcher) {
val streams = mutableListOf<InputStream>()