Skip to content

Commit

Permalink
修复WebAPI的对等体数量显示
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-chu committed Apr 7, 2024
1 parent af6f102 commit d29a3ab
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public NanoHTTPD.Response handle(NanoHTTPD.IHTTPSession session) {
try {
map.put("status", downloader.getLastStatus().name());
List<Torrent> torrents = downloader.getTorrents();
long peers = torrents.stream().mapToLong(t -> downloader.getPeers(t).size()).count();
long peers = torrents.stream().mapToLong(t -> downloader.getPeers(t).size()).sum();
map.put("torrents", torrents.size());
map.put("peers", peers);
} catch (Throwable th) {
Expand Down

0 comments on commit d29a3ab

Please sign in to comment.