From: Matt Joiner Date: Thu, 7 Oct 2021 02:50:13 +0000 (+1100) Subject: Add TorrentStats.PiecesComplete X-Git-Tag: v1.34.0~11 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=72a06d88fce77659348e296b55e589cfce47f061;p=btrtrc.git Add TorrentStats.PiecesComplete Fixes https://github.com/anacrolix/torrent/issues/352. --- diff --git a/torrent.go b/torrent.go index 5693ef1c..3c6a65d9 100644 --- a/torrent.go +++ b/torrent.go @@ -1760,6 +1760,7 @@ func (t *Torrent) statsLocked() (ret TorrentStats) { } } ret.ConnStats = t.stats.Copy() + ret.PiecesComplete = t.numPiecesCompleted() return } diff --git a/torrent_stats.go b/torrent_stats.go index bc54e1bd..0dd58add 100644 --- a/torrent_stats.go +++ b/torrent_stats.go @@ -13,4 +13,5 @@ type TorrentStats struct { ActivePeers int ConnectedSeeders int HalfOpenPeers int + PiecesComplete int }