From 5b4f3de9d5caff8197e550c7ef397a2b48a426e7 Mon Sep 17 00:00:00 2001 From: orignal Date: Tue, 29 Sep 2026 21:04:49 -0400 Subject: [PATCH] return 0 in pecentDone for new magnet --- libi2pd_client/TorrentsRPC.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libi2pd_client/TorrentsRPC.cpp b/libi2pd_client/TorrentsRPC.cpp index 7dfe7fb7..950ff1b1 100644 --- a/libi2pd_client/TorrentsRPC.cpp +++ b/libi2pd_client/TorrentsRPC.cpp @@ -319,7 +319,7 @@ namespace torrents { "totalSize", [](std::shared_ptr torrent) { return boost::json::value(torrent->GetLength ()); } }, { "percentDone", [](std::shared_ptr 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 ()); } },