mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-03 03:17:21 +00:00
Swapped RetrofitRemoteSource.kt for a simplified one
This commit is contained in:
1 parent
13f1cc6455
commit
c8f7a29812
10 files changed
+58
-36
No files matched your search
@@ -40,6 +40,7 @@ class DefaultRepository(
|
||||
"https://www.prismnet.com/~mmccants/tles/classfd.zip",
|
||||
"https://www.prismnet.com/~mmccants/tles/inttles.zip"
|
||||
)
|
||||
override val transmittersSource = "https://db.satnogs.org/api/transmitters/"
|
||||
|
||||
override fun getSatelliteItems() = localSource.getSatelliteItems()
|
||||
|
||||
@@ -78,7 +79,7 @@ class DefaultRepository(
|
||||
localSource.updateEntries(entries)
|
||||
}
|
||||
launch(repoDispatcher) {
|
||||
val transmitters = remoteSource.fetchTransmitters().filter { it.isAlive }
|
||||
val transmitters = remoteSource.fetchTransmitters(transmittersSource)
|
||||
localSource.updateTransmitters(transmitters)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,5 +24,5 @@ interface RemoteDataSource {
|
||||
|
||||
suspend fun fetchFileStream(url: String): InputStream?
|
||||
|
||||
suspend fun fetchTransmitters(): List<Transmitter>
|
||||
suspend fun fetchTransmitters(url: String): List<Transmitter>
|
||||
}
|
||||
@@ -27,6 +27,7 @@ interface DataRepository {
|
||||
|
||||
val defaultSelection: List<Int>
|
||||
val defaultSources: List<String>
|
||||
val transmittersSource: String
|
||||
|
||||
fun getSatelliteItems(): Flow<List<SatItem>>
|
||||
|
||||
|
||||
Reference in new issue
Block a user