return 0 in pecentDone for new magnet

This commit is contained in:
orignal committed 2026-09-29 21:04:49 -04:00
1 parent 2d8efa8d0d
commit 5b4f3de9d5
1 file changed
+1 -1
+1 -1
View File
@@ -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 ());
}
},