From 56bb379024f2b530b1c51705f59cb711907e4a3d Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 14 Jul 2022 16:54:28 +0800 Subject: [PATCH] Add workaround for payload upload/download rate The graphs are showing 0 for both payload upload & download rate but torrent statistics aren't, so suppress it manually. The workaround only applies to paused state for now. Closes #17294. --- src/base/bittorrent/torrentimpl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/base/bittorrent/torrentimpl.cpp b/src/base/bittorrent/torrentimpl.cpp index ffcc12efd..fe7dfeab8 100644 --- a/src/base/bittorrent/torrentimpl.cpp +++ b/src/base/bittorrent/torrentimpl.cpp @@ -1329,12 +1329,14 @@ qreal TorrentImpl::realRatio() const int TorrentImpl::uploadPayloadRate() const { - return m_nativeStatus.upload_payload_rate; + // workaround: suppress the speed for paused state + return isPaused() ? 0 : m_nativeStatus.upload_payload_rate; } int TorrentImpl::downloadPayloadRate() const { - return m_nativeStatus.download_payload_rate; + // workaround: suppress the speed for paused state + return isPaused() ? 0 : m_nativeStatus.download_payload_rate; } qlonglong TorrentImpl::totalPayloadUpload() const