fix in peers
This commit is contained in:
@@ -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})
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user