From 7530d3e257e0c8f4e8db165240908d3ef85eb516 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Mon, 26 Oct 2015 20:49:48 +0100 Subject: [PATCH] Show announce server count (ref #470). --- .../nutomic/syncthingandroid/syncthing/RestApi.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java b/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java index f47e12df..a0fa9580 100644 --- a/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java +++ b/src/main/java/com/nutomic/syncthingandroid/syncthing/RestApi.java @@ -439,16 +439,9 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener, SystemInfo si = new SystemInfo(); si.alloc = system.getLong("alloc"); si.cpuPercent = system.getDouble("cpuPercent"); - if (system.has("extAnnounceOK")) { - JSONObject announce = system.getJSONObject("extAnnounceOK"); - si.extAnnounceTotal = announce.length(); - for (Iterator it = announce.keys(); it.hasNext(); ) { - String key = it.next(); - if (announce.getBoolean(key)) { - si.extAnnounceConnected++; - } - } - } + si.extAnnounceTotal = system.getInt("discoveryMethods"); + si.extAnnounceConnected = + si.extAnnounceTotal - system.getJSONObject("discoveryErrors").length(); si.goroutines = system.getInt("goroutines"); si.myID = system.getString("myID"); si.sys = system.getLong("sys");