mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-23 06:22:30 +00:00
return 0 in pecentDone for new magnet
This commit is contained in:
1 parent
2d8efa8d0d
commit
5b4f3de9d5
1 file changed
+1
-1
@@ -319,7 +319,7 @@ namespace torrents
|
||||
{ "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 (1.0);
|
||||
if (!torrent->GetLength ()) return boost::json::value (0.0);
|
||||
return boost::json::value ((float)(torrent->GetLength () - torrent->GetLeft ())/(float)torrent->GetLength ());
|
||||
}
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user