show torrent availability on remote peer in progress field

This commit is contained in:
orignal
2026-09-03 20:25:45 -04:00
parent e49079f165
commit d608d3f5b2
+2 -1
View File
@@ -385,7 +385,8 @@ namespace torrents
peer["clientIsIntersted"] = it->IsInterested ();
peer["peerIsInterested"] = it->IsRemoteInterested ();
peer["flagStr"] = flags;
peer["progress"] = torrent->GetLength () ? ((float)it->GetDownloaded ())/(float)(torrent->GetLength ()) : 1.0;
const auto& remoteBitfield = it->GetRemoteBitfield ();
peer["progress"] = remoteBitfield.size () ? ((float)remoteBitfield.count ())/((float)remoteBitfield.size ()) : 0.0;
peers.push_back (peer);
}
}