Refactor ranking calculation for direct repeaters and update path handling in channel message screens

This commit is contained in:
Winston Lowe
2026-02-18 09:28:25 -08:00
parent 0a01ecde38
commit 17a9db0f0e
5 changed files with 41 additions and 17 deletions
+1 -2
View File
@@ -59,13 +59,12 @@ class DirectRepeater {
return -1; // Stale repeaters get lowest rank
}
// Higher SNR gets higher rank and recency within maxAgeMinutes breaks ties.
final snrOffset = snr + 31.75;
final ageMs =
DateTime.now().millisecondsSinceEpoch -
lastUpdated.millisecondsSinceEpoch;
final maxAgeMs = maxAgeMinutes * 60 * 1000;
final recencyScore = (maxAgeMs - ageMs).clamp(0, maxAgeMs);
return (snrOffset * 1000).round() + recencyScore;
return (snr * snr).round() + recencyScore;
}
bool isStale() {