diff -U2 -r /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/contrib/webconsole/torrent_client.html /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/contrib/webconsole/torrent_client.html --- /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/contrib/webconsole/torrent_client.html 2026-08-25 18:45:42.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/contrib/webconsole/torrent_client.html 2026-08-25 12:53:24.000000000 +0000 @@ -381,5 +381,5 @@ tbody.innerHTML = ""; currentTorrentsData.forEach((el) => { - const percent = (el.percentDone*100).toFixed(2) + const percent = el.percentDone.toFixed(2) const speed = window.tjs.formatBytes ? window.tjs.formatBytes(el.rateDownload) : (el.rateDownload + ' B/s'); const speed_upload = window.tjs.formatBytes ? window.tjs.formatBytes(el.rateUpload) : (el.rateUpload + ' B/s'); diff -U2 -r /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd_client/Torrents.h /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd_client/Torrents.h --- /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd_client/Torrents.h 2026-08-25 18:45:42.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd_client/Torrents.h 2026-08-25 12:53:24.000000000 +0000 @@ -365,5 +365,4 @@ const std::string& GetPeerID () const { return m_PeerID; } - const std::vector& GetTrackers () const { return m_Trackers; } std::shared_ptr FindTorrent (const Torrent::InfoHash& infoHash) const; std::shared_ptr FindTorrentByID (int id) const; diff -U2 -r /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd_client/TorrentsRPC.cpp /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd_client/TorrentsRPC.cpp --- /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd_client/TorrentsRPC.cpp 2026-08-25 18:45:42.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd_client/TorrentsRPC.cpp 2026-08-25 12:53:24.000000000 +0000 @@ -8,5 +8,5 @@ #include -#if !defined(ANDROID) && (BOOST_VERSION >= 108100) // boost::json since 1.75, we allow it since 1.81 due to std::string_view compatibility +#if BOOST_VERSION >= 108100 // boost::json since 1.75, we allow it since 1.81 due to std::string_view compatibility #include #define JSON_SUPPORTED @@ -48,6 +48,5 @@ int64_t GetTag (boost::json::object& jsonRequest) const; static boost::json::value GetFieldValue (std::string_view field, std::shared_ptr torrent); - boost::json::array GetPeers (std::shared_ptr torrent) const; - boost::json::array GetTrackers (std::shared_ptr torrent) const; + boost::json::array GetPeers (std::shared_ptr torrent); static std::string_view RecognizeClientByPeerID (const PeerConnection::PeerID& peerID); @@ -227,6 +226,4 @@ else if (field == "peers") t["peers"] = GetPeers (torrent); - else if (field == "trackers") - t["trackers"] = GetTrackers (torrent); else { @@ -261,6 +258,8 @@ { "percentDone", [](std::shared_ptr torrent) { - if (!torrent->GetLength ()) return boost::json::value (1.0); - return boost::json::value ((float)(torrent->GetLength () - torrent->GetLeft ())/(float)torrent->GetLength ()); + 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 ); } }, @@ -331,10 +330,5 @@ }, { "error", [](std::shared_ptr torrent) { return boost::json::value(0); } }, // no error - { "eta", [](std::shared_ptr torrent) - { - auto downloadRate = torrent->GetDownloadRate (); - return boost::json::value (downloadRate ? torrent->GetLeft ()/downloadRate : -2); - } - }, + { "eta", [](std::shared_ptr torrent) { return boost::json::value(600); } }, // TODO: { "uploadRatio", [](std::shared_ptr torrent) { @@ -353,5 +347,5 @@ } - boost::json::array JSONRPCHandler::GetPeers (std::shared_ptr torrent) const + boost::json::array JSONRPCHandler::GetPeers (std::shared_ptr torrent) { boost::json::array peers; @@ -393,19 +387,4 @@ } - boost::json::array JSONRPCHandler::GetTrackers (std::shared_ptr torrent) const - { - boost::json::array trackers; - const auto& tunnelTrackers = m_Tunnel->GetTrackers (); - for (size_t i = 0; i < tunnelTrackers.size (); i++) - { - boost::json::object tracker; - tracker["id"] = std::to_string (i); - tracker["announce"] = tunnelTrackers[i]; - tracker["tier"] = 0; - trackers.push_back (tracker); - } - return trackers; - } - std::string_view JSONRPCHandler::RecognizeClientByPeerID (const PeerConnection::PeerID& peerID) {