Merge pull request #2505 from wipedlifepotato/openssl

Процентики
This commit is contained in:
orignal
2026-08-22 08:02:36 -04:00
committed by GitHub
+8
View File
@@ -255,6 +255,14 @@ namespace torrents
{ "pieceCount", [](std::shared_ptr<Torrent> torrent) { return boost::json::value(torrent->GetNumPieces ()); } },
{ "pieceSize", [](std::shared_ptr<Torrent> torrent) { return boost::json::value(torrent->GetPieceLength ()); } },
{ "totalSize", [](std::shared_ptr<Torrent> torrent) { return boost::json::value(torrent->GetLength ()); } },
{ "percentDone", [](std::shared_ptr<Torrent> torrent)
{
if(!torrent->GetLength()) return boost::json::value ( 100.0 );
double left = torrent->GetLength () - torrent->GetLeft();
double percent = (left*100)/torrent->GetLength();
return boost::json::value( percent );
}
},
{ "hashString", [](std::shared_ptr<Torrent> torrent)
{
std::string hexHash;