fix in peers

This commit is contained in:
Mateusz Gruszczyński
2026-06-09 11:19:14 +02:00
parent 16e3917fce
commit b2cede7b63
8 changed files with 759 additions and 305 deletions
+3 -1
View File
@@ -483,13 +483,15 @@ def torrent_peers(torrent_hash: str):
if not profile:
return jsonify({"ok": False, "error": "No profile"}), 400
peers = rtorrent.torrent_peers(profile, torrent_hash)
activity = rtorrent.torrent_peer_activity(profile, torrent_hash)
for peer in peers:
peer.update(lookup_ip(peer.get("ip", "")))
prefs = preferences.get_preferences(profile_id=profile.get("id"))
if int(prefs.get("reverse_dns_enabled") or 0):
# Note: PTR hostnames are attached only when the user enables the lightweight cached resolver.
attach_reverse_dns(peers)
return ok({"peers": peers})
# Note: peer_activity lets the UI silently retry when rTorrent reports traffic before peer rows are visible.
return ok({"peers": peers, "peer_activity": activity})