diff --git a/src/base/bittorrent/torrenthandle.cpp b/src/base/bittorrent/torrenthandle.cpp index bc75f0e9c..cbe77267a 100644 --- a/src/base/bittorrent/torrenthandle.cpp +++ b/src/base/bittorrent/torrenthandle.cpp @@ -519,15 +519,19 @@ int TorrentHandle::piecesHave() const qreal TorrentHandle::progress() const { - if (!m_nativeStatus.total_wanted) - return 0.; + if (!isChecking()) { + if (!m_nativeStatus.total_wanted) + return 0.; - if (m_nativeStatus.total_wanted_done == m_nativeStatus.total_wanted) - return 1.; + if (m_nativeStatus.total_wanted_done == m_nativeStatus.total_wanted) + return 1.; - float progress = static_cast(m_nativeStatus.total_wanted_done) / m_nativeStatus.total_wanted; - Q_ASSERT((progress >= 0.f) && (progress <= 1.f)); - return progress; + qreal progress = static_cast(m_nativeStatus.total_wanted_done) / m_nativeStatus.total_wanted; + Q_ASSERT((progress >= 0.f) && (progress <= 1.f)); + return progress; + } + + return m_nativeStatus.progress; } QString TorrentHandle::category() const diff --git a/src/webui/api/synccontroller.cpp b/src/webui/api/synccontroller.cpp index 1c2126fd2..a90e69a93 100644 --- a/src/webui/api/synccontroller.cpp +++ b/src/webui/api/synccontroller.cpp @@ -327,7 +327,7 @@ namespace // Each value of the 'torrents' dictionary contains map. The map can contain following keys: // - "name": Torrent name // - "size": Torrent size -// - "progress: Torrent progress +// - "progress": Torrent progress // - "dlspeed": Torrent download speed // - "upspeed": Torrent upload speed // - "priority": Torrent priority (-1 if queuing is disabled) diff --git a/src/webui/api/torrentscontroller.cpp b/src/webui/api/torrentscontroller.cpp index c8afa9252..8b6b46c4f 100644 --- a/src/webui/api/torrentscontroller.cpp +++ b/src/webui/api/torrentscontroller.cpp @@ -132,7 +132,7 @@ namespace // - "hash": Torrent hash // - "name": Torrent name // - "size": Torrent size -// - "progress: Torrent progress +// - "progress": Torrent progress // - "dlspeed": Torrent download speed // - "upspeed": Torrent upload speed // - "priority": Torrent priority (-1 if queuing is disabled)