From: Alexander Baranov Date: Thu, 25 Jun 2015 18:02:14 +0000 (+0300) Subject: Make torrent-pick work with latest changes X-Git-Tag: v1.0.0~1139^2 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=029f431ff609b5ff40968d2fbeea53880ae67703;p=btrtrc.git Make torrent-pick work with latest changes --- diff --git a/cmd/torrent-pick/main.go b/cmd/torrent-pick/main.go index 6a6a90e1..3bea027e 100644 --- a/cmd/torrent-pick/main.go +++ b/cmd/torrent-pick/main.go @@ -41,7 +41,7 @@ func resolvedPeerAddrs(ss []string) (ret []torrent.Peer, err error) { func bytesCompleted(tc *torrent.Client) (ret int64) { for _, t := range tc.Torrents() { - if t.Info != nil { + if t.Info() != nil { ret += t.BytesCompleted() } } @@ -81,7 +81,6 @@ func main() { log.SetFlags(log.LstdFlags | log.Lshortfile) var rootGroup struct { Client torrent.Config `group:"Client Options"` - Seed bool `long:"seed" description:"continue seeding torrents after completed"` TestPeers []string `long:"test-peer" description:"address of peer to inject to every torrent"` Pick string `long:"pick" description:"filename to pick"` } @@ -186,7 +185,7 @@ waitDone: os.Stdout.WriteString(progressLine(client)) } } - if rootGroup.Seed { + if rootGroup.Client.Seed { select {} } }