mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-03 11:17:25 +00:00
feat(data): persist ndot and protect manually imported transceivers
- DB v2 migration: entries.ndot column so hasDecayed() actually works after reload (parsed ndot was dropped on write, making the decay detection dead code); radios.isCustom column to mark manually imported transceivers. - updateTransceiversFromFile marks imported radios isCustom=true; remote updates now deleteManagedRadios() then insert the fresh snapshot, keeping manual imports (no source can refresh them, so nothing would bring them back). - Wire MIGRATION_1_2 into MainContainer (fallbackToDestructiveMigration=false would otherwise crash on upgrade).
This commit is contained in:
1 parent
7ef555e377
commit
212dced3c4
10 files changed
+56
-26
No files matched your search
@@ -32,5 +32,7 @@ data class SatRadio(
|
||||
@SerialName("uplink_high") val uplinkHigh: Long?,
|
||||
@SerialName("uplink_mode") val uplinkMode: String?,
|
||||
@SerialName("invert") val isInverted: Boolean,
|
||||
@SerialName("norad_cat_id") val catnum: Int?
|
||||
@SerialName("norad_cat_id") val catnum: Int?,
|
||||
/** Set for manually imported transceivers, which remote updates must not replace. */
|
||||
val isCustom: Boolean = false
|
||||
)
|
||||
@@ -31,6 +31,9 @@ interface ILocalSource {
|
||||
suspend fun getIdsWithModes(modes: List<String>): List<Int>
|
||||
suspend fun getRadiosTotal(): Int
|
||||
suspend fun getRadiosWithId(id: Int): List<SatRadio>
|
||||
suspend fun insertRadios(radios: List<SatRadio>)
|
||||
suspend fun insertRadios(radios: List<SatRadio>, isCustom: Boolean = false)
|
||||
|
||||
/** Delete all non-custom transceivers, keeping manually imported ones. */
|
||||
suspend fun deleteManagedRadios()
|
||||
suspend fun deleteRadios()
|
||||
}
|
||||
Reference in new issue
Block a user