mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-03 19:27:24 +00: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>()
|
||||
|
||||
Reference in new issue
Block a user