mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-04 11:37:22 +00:00
fix: AMSAT name matching token-based; SSTV filters to in-orbit only
- matchesAmSatName: exact token match instead of substring contains, so 'ISS' no longer matches AISSAT-1 and 'AO-7' no longer matches AO-73 (FUNCUBE-1); resolves missing ISS in FM and missing AO-7 in Linear lists - resolveTypeIds: intersect SSTV catnums with current in-orbit TLE set, excluding retired satellites (e.g. TIROS) whose radios are tagged SSTV - add regression tests for token matching
This commit is contained in:
1 parent
e7754a4c9e
commit
30000a913e
4 files changed
+27
-5
No files matched your search
@@ -140,7 +140,7 @@ class DatabaseRepo(
|
||||
fun resolve(names: List<String>): Set<Int> = names.mapNotNull { name ->
|
||||
val keys = dataParser.normalizeAmSatName(name)
|
||||
nameToCatnum.entries.firstOrNull { (localName, _) ->
|
||||
keys.any { key -> localName.contains(key) }
|
||||
dataParser.matchesAmSatName(localName, keys)
|
||||
}?.value
|
||||
}.toSet()
|
||||
val fmCatnums = resolve(fmNames)
|
||||
|
||||
+11
-1
@@ -74,7 +74,17 @@ class SelectionRepo(
|
||||
when (type) {
|
||||
Sources.virtualTypeNames[0] -> idsSet.addAll(settingsRepo.getAmSatFmCatnums())
|
||||
Sources.virtualTypeNames[1] -> idsSet.addAll(settingsRepo.getAmSatLinearCatnums())
|
||||
Sources.virtualTypeNames[2] -> idsSet.addAll(localSource.getIdsWithModes(listOf("SSTV")))
|
||||
// Live SSTV: mode=SSTV transponder records intersected with the
|
||||
// currently-tracked (in-orbit, from the selected TLE sources)
|
||||
// satellites. The raw mode query alone would include retired
|
||||
// weather/experimental birds (e.g. TIROS catnum 1430 whose old
|
||||
// TV downlink is labelled SSTV but is long gone from orbit).
|
||||
Sources.virtualTypeNames[2] -> {
|
||||
val inOrbitIds = currentItems.value.map { it.catnum }.toHashSet()
|
||||
idsSet.addAll(
|
||||
localSource.getIdsWithModes(listOf("SSTV")).filter { it in inOrbitIds }
|
||||
)
|
||||
}
|
||||
else -> idsSet.addAll(settingsRepo.getSatelliteTypesIds(listOf(type)))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user