feat(#3508): Optionally preserve Favorites on nodeDb reset (#3633)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
renovate[bot] 2025-11-11 02:38:45 +00:00 committed by GitHub
parent 81dc625c70
commit e701ad6aee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 68 additions and 14 deletions

View file

@ -182,8 +182,20 @@ interface NodeInfoDao {
lastHeardMin: Int,
): Flow<List<NodeWithRelations>>
@Transaction
fun clearNodeInfo(preserveFavorites: Boolean) {
if (preserveFavorites) {
deleteNonFavoriteNodes()
} else {
deleteAllNodes()
}
}
@Query("DELETE FROM nodes WHERE is_favorite = 0")
fun deleteNonFavoriteNodes()
@Query("DELETE FROM nodes")
fun clearNodeInfo()
fun deleteAllNodes()
@Query("DELETE FROM nodes WHERE num=:num")
fun deleteNode(num: Int)